Haider Ali
Haider Ali

Reputation: 1

Search multiple phrases/terms with weights in elasticsearch

I am new in using elastic-search. I am familiar with basic searching but what now I want is to search multiple terms in a single hit. i.e. I have five search-terms 'first', 'second', 'third', 'four', 'five' and each term has some weight assigned to it. So rather than making a call one by one for each term, what I want a single query that will accept these terms along with their weights and return results according to the weights.

So it should look something like this (This is not the elastic-search syntax)

search
{
  terms: [(first , 3),(second , 1),(thirst , 4),(four , 2),(five , 5)],
  fields: [field1, field2, field3...]
}

Thanks in anticipation.

Upvotes: 0

Views: 1232

Answers (1)

dumplingplus
dumplingplus

Reputation: 41

The query string query supports boosting in the following form:

quick^2 fox

Upvotes: 0

Related Questions