Hi Guy,
sounds like you are looking for the function score query:
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-function-score-query.html
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."
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-function-score-query.html#_decay_functions
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.
Thanks
Guy
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/534D37E5.8060609%40hkorte.com.
For more options, visit https://groups.google.com/d/optout.