1

I have an airports database in Azure Search which upon searching I would like to boost results with those airports that contains the word "international" in the airport name.

given 2 results that have the same score, i would like to boost the one that has the word "international" in the airport name using just Azure Search (i.e. if possible, not using any code to manipulate after getting the relevant results).

I tried Term Boosting but it returns me a list of airports that has "international" in them which is not what I want.

I looked at the Scoring Functions but none of them seems to suit my needs

in essence, i do not want to "match" results that contains the word "international" but i want to "boost" results that contains the word "international" after the user keys in the query text

icube
  • 2,578
  • 1
  • 30
  • 63

1 Answers1

3

If you want results containing a term to score higher, but you don't want to require matching documents to contain the term, you can use OR as well as AND. For example, if the user typed "Dallas", your query could look like this:

Dallas OR (Dallas AND airportName:international)

If you further want to control the impact that the term international has on the score, you can use term boosting.

You might find this article on how Azure Search processes queries to be helpful.

Bruce Johnston
  • 8,344
  • 3
  • 32
  • 42
  • thanks for the reply. I tried but that is not the behavior I wanted. I don't want to "filter" results with the term "international" in them. I want to still search Dallas, and in the event that there are 2 results of the same score, preference the one that has international in them... its more like after the initial search result returns, boost those that has international in them – icube Jun 28 '17 at 15:23
  • @icube How about 'Dallas OR (Dallas AND airportName:international)'... Would that do it? – Bruce Johnston Jun 28 '17 at 20:07