I have a simple problem where it would be useful to a query like: get me
everything that matches except if field foo is in results of
.
The simple solution is to first do query2, fetch the foo field for all the
results (potentially thousands), stuff it in some hash and generate a
gigantic set with all the values of the foo field and turn that into a bool
filter with a lot of term queries in the not that gets added to query1.
Since I need to support paging through the results, I can't get away with
simply tossing deduplicating the result set in memory.
Is there a more elegant way to do this in elasticsearch?
Don't know for sure, but did you try using a filter query ?
On Wednesday, June 11, 2014 9:52:20 AM UTC-3, Jilles van Gurp wrote:
I have a simple problem where it would be useful to a query like: get me
everything that matches except if field foo is in results of
.
The simple solution is to first do query2, fetch the foo field for all the
results (potentially thousands), stuff it in some hash and generate a
gigantic set with all the values of the foo field and turn that into a bool
filter with a lot of term queries in the not that gets added to query1.
Since I need to support paging through the results, I can't get away with
simply tossing deduplicating the result set in memory.
Is there a more elegant way to do this in elasticsearch?
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.