I want to index a tree-like structure in ElasticSearch. That structure is
an (let's call it) Item, that has a child Items. Each of the child may have
their own child Items.
What I'm trying to achieve is to make a text search on the Items and return
root elements which have at least one child in the whole structure that
matches the search.
In addition I need to have a facet on another field in the structure and
again, I would want it to count only the root elements that has at least
one child that matches.
I end up using parent/child objects in ElasticSearch, indexing root element
as parent and flattening the rest of the tree structure so every item in
the structure is a child of the root element.
The searching in this case works fine, but I'm not able to create a terms
facet on the child elements - I would like to have a facet on a particular
field in a child.
Is there a way to handle those facets any other way, or maybe another way
of handling the whole tree-like structure?
I have the same problem as you, so far, no implemention is their in elasticsearch against the hierarchical facet,like path facet in bobo browse. but now i am trying a solution , let's say,
we have the model
a/b1/c
a/b2/d
i index the date as an array,
['a', 'a/b1', 'a/b1/c']
['a', 'a/b2', 'c/b2/d'],
Hmm, if you are still having this problem you can take a look at this:
On Friday, March 15, 2013 3:45:15 PM UTC+4, Paweł Młynarczyk wrote:
Hello everybody
I want to index a tree-like structure in Elasticsearch. That structure is
an (let's call it) Item, that has a child Items. Each of the child may have
their own child Items.
What I'm trying to achieve is to make a text search on the Items and
return root elements which have at least one child in the whole structure
that matches the search.
In addition I need to have a facet on another field in the structure and
again, I would want it to count only the root elements that has at least
one child that matches.
I end up using parent/child objects in Elasticsearch, indexing root
element as parent and flattening the rest of the tree structure so every
item in the structure is a child of the root element.
The searching in this case works fine, but I'm not able to create a terms
facet on the child elements - I would like to have a facet on a particular
field in a child.
Is there a way to handle those facets any other way, or maybe another way
of handling the whole tree-like structure?
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.