I have documents (accommodations) stored with a numeric attribute - "number
of beds"
I'd like to be able to boost by a certain amount if that number is close to
a search query.
e.g. prefer documents with a number of beds close to what is being searched
for.
This will be added to the rest of the search criteria - is there a way to
do this? I can filter by a number within a range, but would like the
results returned to take some ordering from the closeness of the number
searched for.
sounds like you are looking for the function score query:
And there maybe especially for the decay functions:
"Decay functions score a document with a function that decays depending
on the distance of a numeric field value of the document from a user
given origin. This is similar to a range query, but with smooth edges
instead of boxes."
Have a look at all the beautiful example plots Britta created..
Best regards,
Hannes
On 15.04.2014 15:18, Guy Bowden wrote:
Hi,
I have documents (accommodations) stored with a numeric attribute - "number
of beds"
I'd like to be able to boost by a certain amount if that number is close to
a search query.
e.g. prefer documents with a number of beds close to what is being searched
for.
This will be added to the rest of the search criteria - is there a way to
do this? I can filter by a number within a range, but would like the
results returned to take some ordering from the closeness of the number
searched for.
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.