Hello,
for testing i generated a category hierachy ("V_Category") which has 4
levels and 5 categories per level, starting from one ROOT-category (#17:0).
The hierachy is build up with "E_CH" category hierachy edges (
parentCategory.addEdge(EEdges.E_CH.name(), childCategory); ). At all 1364
categories.
I also generated 500 documents which have assigned randomly 1 to 10 of the
above categories:
nextInt = RandomUtils.nextInt(9) + 1;
for (int j = 0; j < nextInt; j++) {
OrientVertex orientVertex = nextRandomCategory().getOrientVertex
();
document.addEdge(EEdges.E_Category.name(), orientVertex);
}
i want to select the number of documents assigned to a category. What i
tried ist:
select count(in('E_Category')) from (traverse out('E_CH'), in('E_Category')
from #17:0)
What i expect to get is 500 since i have 500 documets. What i get is 1866
which is 1364(number of categories) +500(number of documents) +2 (?). Even
if i change the number of categories this formula seems to be constant:
number of categories+number of documents+2. The good thing: the duplicates
(one cocument may have several categories) already seem to be removed (no
distinct necessary).
How do i have to change the querry to get only the number of documents
which have assigned one or more categories from the given root category and
all child categories.
--
---
You received this message because you are subscribed to the Google Groups
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.