Boosting results based on another field?

Hi,

I'm new to ElasticSearch, trying to see if I could migrate a website
from Solr to ES.

One of the features I need is to boost search results based on the
value of another field. All my documents have a field "popularity"
which is an integer. When a user makes a search, I want to return
results that are the best match but also take popularity into
account.

Right now in Solr when someone searches for "foo" I do something
like:

q={!boost b=log(popularity)}foo

which basically multiplies the "natural" scoring of a document with
the log of the popularity of that document.

Is it possible to do something similar in ElasticSearch?

Thanks.

Hi Andy

Right now in Solr when someone searches for "foo" I do something
like:

q={!boost b=log(popularity)}foo

which basically multiplies the "natural" scoring of a document with
the log of the popularity of that document.

You can use a custom_score query to do this:

clint

Great! Thanks Clinton.

On Jun 2, 2:55 pm, Clinton Gormley clin...@iannounce.co.uk wrote:

Hi Andy

Right now in Solr when someone searches for "foo" I do something
like:

q={!boost b=log(popularity)}foo

which basically multiplies the "natural" scoring of a document with
the log of the popularity of that document.

You can use a custom_score query to do this:

Elasticsearch Platform — Find real-time answers at scale | Elastic...

clint