0

I am trying to find how boosting works in cloudant search index. i.e, if I want search by words "some text" and increase the boost for "some" to 4 and "text" to 1. is Cloudant is going to search first for docs which has "some" and then search for "text" in the returned docs from first search. or is it going to search for both "some" and "text" at the same time and calculate relavance based matches

1 Answers1

3

If you ask Cloudant to perform a search operation and employ the boost operator '^' then the relevance scores for each document will be calculated to using the boost number you provide. For example, a search query:

q=some^4 text^1

will find documents matching the word 'some' or 'text' but documents matching 'some' will have a greater score because you have indicated that 'some' is four times more important than 'text'. The records return would be the same with or without the boost operator, but the sort ordering would be affected by the boosting.

Boost is also useful for boosting search clauses too e.g.

q=(priceplan:premium AND str:"some text")^10 OR (priceplan:basic AND str:"some text")

The above query moves 'premium' documents to the top of the pile.

Glynn Bird
  • 5,507
  • 2
  • 12
  • 21
  • +1 for you! Very simple explanation. Cloudant API documentation doesn't seem to let me in, but this has helped me tremendously – JamesBlandford Dec 04 '17 at 14:45