I need to use facet navigation for filtering search result. By adding each
term I can build query filter like* (Attribute1=term1 OR Attribute1=term2)
AND (Attribute2=term4)*. So when I have such query, then in facet
navigation I'd like to have all available terms with counts showing
increase with new possible increase in final result set, in short user
would see how many new documents will be added to search result set.
Example:
Applied filter (Attribute1=term1 OR Attribute1=term2) AND
(Attribute2=term4)
Facet navigation
Attribute 1
term1 (applied) - count here is 0, because I cannot add more documents
to final result
term2 (applied) - count here is 0, because I cannot add more
documents to final result
term3 - count would be the number of matching documents with filter Attribute2 = term4 AND Attribute=term3
Attribute 2
term4 (applied) - count here is 0, because I cannot add more
documents to final result
term5 - count would be the number of matching documents with filter
(Attribute1=term1 OR Attribute1=term2) AND Attribute2=term5
Can anyone advice how would search request to ES look like?
Here an example how to replicate it and what I'd like to receive.
Thanks a lot. Jaro
On Sunday, December 2, 2012 12:41:06 AM UTC+2, Jaromír Müller wrote:
Hi everyone,
I need to use facet navigation for filtering search result. By adding each
term I can build query filter like* (Attribute1=term1 OR
Attribute1=term2) AND (Attribute2=term4)*. So when I have such query,
then in facet navigation I'd like to have all available terms with counts
showing increase with new possible increase in final result set, in short
user would see how many new documents will be added to search result set.
Example:
Applied filter (Attribute1=term1 OR Attribute1=term2) AND
(Attribute2=term4)
Facet navigation
Attribute 1
term1 (applied) - count here is 0, because I cannot add more
documents to final result
term2 (applied) - count here is 0, because I cannot add more
documents to final result
term3 - count would be the number of matching documents with
filter Attribute2 = term4 AND Attribute=term3
Attribute 2
term4 (applied) - count here is 0, because I cannot add more
documents to final result
term5 - count would be the number of matching documents with
filter (Attribute1=term1 OR Attribute1=term2) AND Attribute2=term5
Can anyone advice how would search request to ES look like?
Could anyone advice if my solution is correct or is there any possible
improvement?
Thanks, Jaro.
On Sunday, December 2, 2012 12:41:06 AM UTC+2, Jaromír Müller wrote:
Hi everyone,
I need to use facet navigation for filtering search result. By adding each
term I can build query filter like* (Attribute1=term1 OR
Attribute1=term2) AND (Attribute2=term4)*. So when I have such query,
then in facet navigation I'd like to have all available terms with counts
showing increase with new possible increase in final result set, in short
user would see how many new documents will be added to search result set.
Example:
Applied filter (Attribute1=term1 OR Attribute1=term2) AND
(Attribute2=term4)
Facet navigation
Attribute 1
term1 (applied) - count here is 0, because I cannot add more
documents to final result
term2 (applied) - count here is 0, because I cannot add more
documents to final result
term3 - count would be the number of matching documents with
filter Attribute2 = term4 AND Attribute=term3
Attribute 2
term4 (applied) - count here is 0, because I cannot add more
documents to final result
term5 - count would be the number of matching documents with
filter (Attribute1=term1 OR Attribute1=term2) AND Attribute2=term5
Can anyone advice how would search request to ES look like?
I cannot think of any other approach besides using filter facets. Facets
are typically used to narrow searches instead of expanding them. In your
case you are trying to expand your search and that means you have to run
all these extra searches for each "facet". You could also use multisearch
to do the same thing, but your solution will probably use caches better.
On Sunday, December 2, 2012 2:53:06 PM UTC-5, Jaromír Müller wrote:
In the end I found the solution which is based on facet_filter
Could anyone advice if my solution is correct or is there any possible
improvement?
Thanks, Jaro.
On Sunday, December 2, 2012 12:41:06 AM UTC+2, Jaromír Müller wrote:
Hi everyone,
I need to use facet navigation for filtering search result. By adding
each term I can build query filter like* (Attribute1=term1 OR
Attribute1=term2) AND (Attribute2=term4)*. So when I have such query,
then in facet navigation I'd like to have all available terms with counts
showing increase with new possible increase in final result set, in short
user would see how many new documents will be added to search result set.
Example:
Applied filter (Attribute1=term1 OR Attribute1=term2) AND
(Attribute2=term4)
Facet navigation
Attribute 1
term1 (applied) - count here is 0, because I cannot add more
documents to final result
term2 (applied) - count here is 0, because I cannot add more
documents to final result
term3 - count would be the number of matching documents with
filter Attribute2 = term4 AND Attribute=term3
Attribute 2
term4 (applied) - count here is 0, because I cannot add more
documents to final result
term5 - count would be the number of matching documents with
filter (*Attribute1=term1 OR Attribute1=term2) AND Attribute2=term5
Can anyone advice how would search request to ES look 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.