Re: does there exists an exists query
Hello Ivan thank you very much for your suggestion. I will try this! Kind regards Am Montag, 10. November 2014 19:13:43 UTC+1 schrieb Ivan Brusic: Off the top of my head, the easiest option would be to use a constant score query. Wrap the original query and provide a boost to documents that satisfy your exist filter. Cheers, Ivan On Mon, Nov 10, 2014 at 12:54 PM, Volker s...@klest.de javascript: wrote: I would like to know whether there is an exists query in ES. I know that there is an exists filter, but I would like to have an exists query. So documents, where a field exists, should be rated higher than the ones, where the field does not exists. But if there is no document in that query, where the field exists, it should still return the other documents. This would not work with the exists filter, as far as I know. I know, that I could index an additional field, with the value (e.g.) true, when the field exists. But I would rather not have this additional data in the index. So, what is the best solution for this use case? thanks in advance! -- 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/e82e64a1-53d7-4067-9a91-ce77fda8c85f%40googlegroups.com https://groups.google.com/d/msgid/elasticsearch/e82e64a1-53d7-4067-9a91-ce77fda8c85f%40googlegroups.com?utm_medium=emailutm_source=footer . For more options, visit https://groups.google.com/d/optout. -- 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+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/8b5a31b0-b3ee-4b82-991d-d85436793327%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
does there exists an exists query
I would like to know whether there is an exists query in ES. I know that there is an exists filter, but I would like to have an exists query. So documents, where a field exists, should be rated higher than the ones, where the field does not exists. But if there is no document in that query, where the field exists, it should still return the other documents. This would not work with the exists filter, as far as I know. I know, that I could index an additional field, with the value (e.g.) true, when the field exists. But I would rather not have this additional data in the index. So, what is the best solution for this use case? thanks in advance! -- 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+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/e82e64a1-53d7-4067-9a91-ce77fda8c85f%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: path facets
yes... just two month :-) in the meantime I have solved the problem. not with an array, but with a map. It works and it is fast :-) Thanks. kind regards PS: and maybe till may in Hamburg Am Freitag, 4. April 2014 09:57:58 UTC+2 schrieb Alexander Reelsen: Hey, I remember barely, that was already more than two months ago ;-) Again with the use case of categories, you may want to drill down in a hierarchical way, however this does not mean, that your data structures have to be like that (you could still handle your categories in an array and apply filters differently, so it looks like a hierarchy). However, I remember a talk about that at one of the last munich search meetups, dont see that the presentation is online though (need to reask the speaker for publishing it) --Alex On Tue, Apr 1, 2014 at 6:22 PM, Volker s...@klest.de javascript:wrote: do you remember your talk about ecommerce and ES in Hamburg? :-) viewing and drilling down in a catalogue is also a valid use case, where you need to drill down on hirarchical faceted data. is there an easy way to do that in ES or do I have to aggregate the facets by myself? kind regards Am Montag, 31. März 2014 10:11:31 UTC+2 schrieb Alexander Reelsen: Hey, havent spent a lot of thought, if or how you can solve this directly, but wouldnt it be much easier if you used different fields like 'continent', 'country', 'state', 'city' and would simply aggregate on those and use it for drill down? Or does it have to be generic and this is just an example? --Alex On Sun, Mar 30, 2014 at 6:05 PM, Volker s...@klest.de wrote: dear reader I have a question about facets. I have documents with a path as part of a document. e.g.: /america/ /america/usa /america/usa/california /america/usa/new-york /america/mexico /europe/spain /europe/germany I would like to drill down on an area and get a facet count for the next level. If I filter in the facet e.g. for america I would like to get counts for - /america/usa - /america/mexico I started with using a prefix filter in the facet to filter e.g. for america but then I get - /america/usa - /america/usa/california - /america/usa/new-york - /america/mexico but I would like to get the facet counts for only the next level, so I can drill down on the area. I tried a search for this topic, but I did not find a solution. Hope that somebody can help. 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. To view this discussion on the web visit https://groups.google.com/d/ msgid/elasticsearch/0f825504-2d93-43ff-ab7f-f2dfd0866816% 40googlegroups.comhttps://groups.google.com/d/msgid/elasticsearch/0f825504-2d93-43ff-ab7f-f2dfd0866816%40googlegroups.com?utm_medium=emailutm_source=footer . For more options, visit https://groups.google.com/d/optout. -- 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/d2516db2-416d-4d36-9284-6d145727f5a5%40googlegroups.comhttps://groups.google.com/d/msgid/elasticsearch/d2516db2-416d-4d36-9284-6d145727f5a5%40googlegroups.com?utm_medium=emailutm_source=footer . For more options, visit https://groups.google.com/d/optout. -- 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+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/ef682805-4148-4edc-a413-6ed41b6cafc4%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: path facets
do you remember your talk about ecommerce and ES in Hamburg? :-) viewing and drilling down in a catalogue is also a valid use case, where you need to drill down on hirarchical faceted data. is there an easy way to do that in ES or do I have to aggregate the facets by myself? kind regards Am Montag, 31. März 2014 10:11:31 UTC+2 schrieb Alexander Reelsen: Hey, havent spent a lot of thought, if or how you can solve this directly, but wouldnt it be much easier if you used different fields like 'continent', 'country', 'state', 'city' and would simply aggregate on those and use it for drill down? Or does it have to be generic and this is just an example? --Alex On Sun, Mar 30, 2014 at 6:05 PM, Volker s...@klest.de javascript:wrote: dear reader I have a question about facets. I have documents with a path as part of a document. e.g.: /america/ /america/usa /america/usa/california /america/usa/new-york /america/mexico /europe/spain /europe/germany I would like to drill down on an area and get a facet count for the next level. If I filter in the facet e.g. for america I would like to get counts for - /america/usa - /america/mexico I started with using a prefix filter in the facet to filter e.g. for america but then I get - /america/usa - /america/usa/california - /america/usa/new-york - /america/mexico but I would like to get the facet counts for only the next level, so I can drill down on the area. I tried a search for this topic, but I did not find a solution. Hope that somebody can help. 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/0f825504-2d93-43ff-ab7f-f2dfd0866816%40googlegroups.comhttps://groups.google.com/d/msgid/elasticsearch/0f825504-2d93-43ff-ab7f-f2dfd0866816%40googlegroups.com?utm_medium=emailutm_source=footer . For more options, visit https://groups.google.com/d/optout. -- 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+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/d2516db2-416d-4d36-9284-6d145727f5a5%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
path facets
dear reader I have a question about facets. I have documents with a path as part of a document. e.g.: /america/ /america/usa /america/usa/california /america/usa/new-york /america/mexico /europe/spain /europe/germany I would like to drill down on an area and get a facet count for the next level. If I filter in the facet e.g. for america I would like to get counts for - /america/usa - /america/mexico I started with using a prefix filter in the facet to filter e.g. for america but then I get - /america/usa - /america/usa/california - /america/usa/new-york - /america/mexico but I would like to get the facet counts for only the next level, so I can drill down on the area. I tried a search for this topic, but I did not find a solution. Hope that somebody can help. 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 elasticsearch+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/0f825504-2d93-43ff-ab7f-f2dfd0866816%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: how does facets work
Dear Ivan thank you very much for your fast and helpful response. I will create some demo data and play with your snippet. I really appreciate your help! btw... I think my scenario is a very standard scenario for working with facets -- e.g. every online shop is working in this fashion with facets. kind regards Volker Am Montag, 30. Dezember 2013 18:36:31 UTC+1 schrieb Ivan Brusic: After reading your scenario again, I have modified slightly my suggestion. You would still need to use a post filter since the facets need to work on set of documents that is greater than the set returned. You can apply the same post filter as a facet filter on the facet you want to reduce. Here is an example: https://gist.github.com/brusic/8185134 -- Ivan -- 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+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/18a41661-021b-4833-86f1-423223da7a20%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
how does facets work
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) [x] 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 elasticsearch+unsubscr...@googlegroups.com. 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.
Re: how does facets work
Dear Ivan thank you very much for your pointers. I will read through it and come back, if I have further questions! thanks 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: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-post-filter.html https://github.com/elasticsearch/elasticsearch/issues/4119 The post filter documentation has some insight on how the filters affect the facets. In your case, you want a filtered query ( http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-filtered-query.html ) 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) [x] 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+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/85f17064-1226-4f0b-9435-2b17790afd4e%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.