I am new to ElasticSearch and I am trying to move some of my documents to
the top of the search results. (I have a "is_premium" field in my documents
and also a "popularity" value that is calculated by our system) The premium
documents should always be on the top of the search results (huge boost
factor) and popularity value should change the ordering of the rest of the
search results (small boost factor)
So I think I need some document boosting. I already have added a "boost"
value when adding documents to the index. This works as expected for
putting all "is_premium" documents to the top.
But now I have read in a blog post [1] that this way of doing things is
deprecated. A better way of boosting this is doing a function score query
where you calculate the boost value on query time, not on index time like
with document boosting.
So my question are:
a) Is document boosting on index time really deprecated and if yes, why?
b) I need some in wrapping my head around creating a custom query with
function score boosting (I use Django Haystack with Elastic-Search so no
manual query creation was necessary up until now.)
This is the test query I put together:
But I get an error which I do not understand:
QueryParsingException[[haystack] script_score the script could not be
loaded]; nested: ScriptException[dynamic scripting for [mvel] disabled]
Has anyone some tips for me on how to get this query working?
Look into field value factor, which was added in 1.2
--
Ivan
On Oct 7, 2014 9:01 AM, "Anton Pirker" anton@ignaz.at wrote:
Hello all!
I am new to Elasticsearch and I am trying to move some of my documents to
the top of the search results. (I have a "is_premium" field in my documents
and also a "popularity" value that is calculated by our system) The premium
documents should always be on the top of the search results (huge boost
factor) and popularity value should change the ordering of the rest of the
search results (small boost factor)
So I think I need some document boosting. I already have added a "boost"
value when adding documents to the index. This works as expected for
putting all "is_premium" documents to the top.
But now I have read in a blog post [1] that this way of doing things is
deprecated. A better way of boosting this is doing a function score query
where you calculate the boost value on query time, not on index time like
with document boosting.
So my question are:
a) Is document boosting on index time really deprecated and if yes, why?
b) I need some in wrapping my head around creating a custom query with
function score boosting (I use Django Haystack with Elastic-Search so no
manual query creation was necessary up until now.)
This is the test query I put together:
But I get an error which I do not understand:
QueryParsingException[[haystack] script_score the script could not be
loaded]; nested: ScriptException[dynamic scripting for [mvel] disabled]
Has anyone some tips for me on how to get this query working?
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.