Faceted Navigation, as can be seen in *LinkedIn *and *Booking.com*,
include the fundamental characteristic that the value-count of each faceted
field is constrained by the query (set of matched documents), *excluding *any
constraint on the given field itself.
For example, in LinkedIn, If the "locations" facet is currently
filtered with "Canada" (the "Canada" check-box is selected), the facet will
still include counts for the other locations.
It seems that Elasticsearch lacks the feature to count the terms in the
set of matched documents, AS IF the faceted field itself was not a part of
the query. Am I correct?
And thus, if I have *n* faceted fields in my faceted navigation, each
clicked checkbox involves executing n separate queries - one to modify
the actual result set, and n-1 to rebuild the other facets (each one with
a query which excludes its field).
Faceted Navigation, as can be seen in LinkedIn and Booking.com, include the fundamental characteristic that the value-count of each faceted field is constrained by the query (set of matched documents), excluding any constraint on the given field itself.
For example, in LinkedIn, If the "locations" facet is currently filtered with "Canada" (the "Canada" check-box is selected), the facet will still include counts for the other locations.
It seems that Elasticsearch lacks the feature to count the terms in the set of matched documents, AS IF the faceted field itself was not a part of the query. Am I correct?
And thus, if I have n faceted fields in my faceted navigation, each clicked checkbox involves executing n separate queries - one to modify the actual result set, and n-1 to rebuild the other facets (each one with a query which excludes its field).
Did I get this right? any better ways to do this?
Faceted Navigation, as can be seen in *LinkedIn *and *Booking.com*,
include the fundamental characteristic that the value-count of each faceted
field is constrained by the query (set of matched documents), *excluding *any
constraint on the given field itself.
For example, in LinkedIn, If the "locations" facet is currently
filtered with "Canada" (the "Canada" check-box is selected), the facet will
still include counts for the other locations.
It seems that Elasticsearch lacks the feature to count the terms in
the set of matched documents, AS IF the faceted field itself was not a part
of the query. Am I correct?
And thus, if I have *n* faceted fields in my faceted navigation, each
clicked checkbox involves executing n separate queries - one to modify
the actual result set, and n-1 to rebuild the other facets (each one
with a query which excludes its field).
Hi David,
post filter could have been a solution for single faceted-field
scenario. However each facet in a multi-facet scenario needs to be affected
by constraints on the other faceted-fields.
בתאריך יום שלישי, 29 ביולי 2014 12:40:24 UTC+3, מאת David Pilato:
In that case, you should look at post filters instead of adding filters to
the query.
My 2 cents
--
David
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
Le 29 juil. 2014 à 11:32, Adam Porat <adam....@gmail.com <javascript:>> a
écrit :
Hi,
Faceted Navigation, as can be seen in *LinkedIn *and *Booking.com
http://Booking.com*, include the fundamental characteristic that the
value-count of each faceted field is constrained by the query (set of
matched documents), *excluding *any constraint on the given field itself.
For example, in LinkedIn, If the "locations" facet is currently
filtered with "Canada" (the "Canada" check-box is selected), the facet will
still include counts for the other locations.
It seems that Elasticsearch lacks the feature to count the terms in
the set of matched documents, AS IF the faceted field itself was not a part
of the query. Am I correct?
And thus, if I have *n* faceted fields in my faceted navigation, each
clicked checkbox involves executing n separate queries - one to modify
the actual result set, and n-1 to rebuild the other facets (each one
with a query which excludes its field).
Hi Adrien, it looks like your link gives the best answer, basically use the
construct:
{
"query": {
"filtered": {
"query": "your query goes here",
"filter": "filters to take into account for top-hits and aggs"
}
},
"post_filter" : "filters to take into account for top-hits only",
"aggs": {
"my_filter": {
"filter": "filter to take into account for aggs only"
}
}}
בתאריך יום שלישי, 29 ביולי 2014 12:42:13 UTC+3, מאת Adrien Grand:
On Tue, Jul 29, 2014 at 11:32 AM, Adam Porat <adam....@gmail.com
<javascript:>> wrote:
Hi,
Faceted Navigation, as can be seen in *LinkedIn *and *Booking.com*,
include the fundamental characteristic that the value-count of each faceted
field is constrained by the query (set of matched documents), *excluding
*any constraint on the given field itself.
For example, in LinkedIn, If the "locations" facet is currently
filtered with "Canada" (the "Canada" check-box is selected), the facet will
still include counts for the other locations.
It seems that Elasticsearch lacks the feature to count the terms in
the set of matched documents, AS IF the faceted field itself was not a part
of the query. Am I correct?
And thus, if I have *n* faceted fields in my faceted navigation,
each clicked checkbox involves executing n separate queries - one to
modify the actual result set, and n-1 to rebuild the other facets
(each one with a query which excludes its field).
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.