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.
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 svs@klest.de 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.
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.
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.