Hopefully this makes sense.
after reading through your provided links... not totally
If I apply the selected facet before the the facet calculation, the facet
will count only elements, that are part of the result. That would mean,
that I would not get numbers for the not selected models (in this case no
numbers for bmw and ford).
If I apply the selected facet as a post_filter, I will get the correct
numbers for the unselected models, but the facets for the color does not
represent the numbers for the selected model, but for all models.
But probably I have not understood it, as it was meant.
Could you please elaborate further, how the query/filter for a selected
facet should be formulated? I have not found any example for this. If there
is one online, I would appreciate a link to that example.
Kind regards
Am Freitag, 27. Dezember 2013 18:58:13 UTC+1 schrieb Ivan Brusic:
Facets work on the documents returned by the query. This behavior will
not work in your case since you would like to gather facets on a greater
set of documents, not just the ones returned by the query. To solve this
issue, elasticsearch provides a post filter, which affects the result
document set, but not the set of documents that the facets work on.
The term "filter" is a bit overloaded in elasticsearch, so the team
renamed the post filter to a more explicit "post_filter":
Elasticsearch Platform — Find real-time answers at scale | Elastic
Rename filter param to search api "post_filter" · Issue #4119 · elastic/elasticsearch · GitHub
The post filter documentation has some insight on how the filters affect
the facets. In your case, you want a filtered query (
Elasticsearch Platform — Find real-time answers at scale | Elastic )
with the color as the filter, but the model filter will be applied as a
post filter. Hopefully this makes sense.
Cheers,
Ivan
On Fri, Dec 27, 2013 at 9:41 AM, Volker <s...@klest.de <javascript:>>wrote:
Dear Readers
I have a question about facets and doing some filtering based on facets.
In the moment I am using hibernate search in combination with bobobrowse
for facetting and I am thinking about switching to ES. But before that I
would like to check whether I can still get the same functionality.
lets asume that I have an index about cars and some facets -- eg. model
and color.
color
red (10)
blue (5)
green (2)
model
bmw (4)
vw (5)
ford (8)
if I select a model I would like to get only color facets for that model,
but I still would like to get facets for all models. eg:
color
red (2)
blue (2)
green (1)
model
bmw (4)
vw (5)
ford (8)
I have searched I did not find an example about this usecase. Is this
possible and if yes, how do I filter a query to get these results?
Kind regards
--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearc...@googlegroups.com <javascript:>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/9d1f3008-aff2-4936-8e6c-7611734e7418%40googlegroups.com
.
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/2609a3ee-1124-4bc1-95e6-c6e7cdb06128%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.