I'm actually working on a faceted search, and I can't find a good
solution to a problem (in the docs nor with my best friend Google ;)).
One of the facets I have to manage has to be hierarchical (it's a
category filter, one record can have multiple categories of multiple
levels). Example :
First level on search :
[ ] Computers (10)
[ ] Sea (5)
User checks "Computers". We have to give him all records associated
to category "computers" (or to any subcategory), and to propose the
sub-categories facetized :
[ x ] Computers (10)
[ ] Internet (6)
[ ] Hardware (2)
My problem is to get only facet counts for categories under
"Computers", as a record can be associated to "Internet" and to a
subcategory of "Sea".
The only solution I can find for the moment, is to use the "regex"
param with a list of ids corresponding to subcategories of
"Computer" ( regex : "1|2|3"), but it's not really elegant.
Does somebody have a better idea/solution to filter the terms ?
One of the facets I have to manage has to be hierarchical (it's a
category filter, one record can have multiple categories of multiple
levels). Example :
First level on search :
[ ] Computers (10)
[ ] Sea (5)
User checks "Computers". We have to give him all records associated
to category "computers" (or to any subcategory), and to propose the
sub-categories facetized :
[ x ] Computers (10)
[ ] Internet (6)
[ ] Hardware (2)
My problem is to get only facet counts for categories under
"Computers", as a record can be associated to "Internet" and to a
subcategory of "Sea".
The only solution I can find for the moment, is to use the "regex"
param with a list of ids corresponding to subcategories of
"Computer" ( regex : "1|2|3"), but it's not really elegant.
I'm actually working on a faceted search, and I can't find a good
solution to a problem (in the docs nor with my best friend Google ;)).
One of the facets I have to manage has to be hierarchical (it's a
category filter, one record can have multiple categories of multiple
levels). Example :
First level on search :
[ ] Computers (10)
[ ] Sea (5)
User checks "Computers". We have to give him all records associated
to category "computers" (or to any subcategory), and to propose the
sub-categories facetized :
[ x ] Computers (10)
[ ] Internet (6)
[ ] Hardware (2)
My problem is to get only facet counts for categories under
"Computers", as a record can be associated to "Internet" and to a
subcategory of "Sea".
The only solution I can find for the moment, is to use the "regex"
param with a list of ids corresponding to subcategories of
"Computer" ( regex : "1|2|3"), but it's not really elegant.
Does somebody have a better idea/solution to filter the terms ?
I'm actually working on a faceted search, and I can't find a good
solution to a problem (in the docs nor with my best friend Google ;)).
One of the facets I have to manage has to be hierarchical (it's a
category filter, one record can have multiple categories of multiple
levels). Example :
First level on search :
[ ] Computers (10)
[ ] Sea (5)
User checks "Computers". We have to give him all records associated
to category "computers" (or to any subcategory), and to propose the
sub-categories facetized :
[ x ] Computers (10)
[ ] Internet (6)
[ ] Hardware (2)
My problem is to get only facet counts for categories under
"Computers", as a record can be associated to "Internet" and to a
subcategory of "Sea".
The only solution I can find for the moment, is to use the "regex"
param with a list of ids corresponding to subcategories of
"Computer" ( regex : "1|2|3"), but it's not really elegant.
Does somebody have a better idea/solution to filter the terms ?
I store two values in my ES index:
'category_id': {'type': 'integer'},
'category_ids': {'type': 'integer'},
where the second one is only for facets. It's not a path of ids
(string), but list of integers. I'm not sure it's the best solution, but
i don't need to use regex. my query looks like:
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.