I want to apply negative boosting to items, based on the value of an indexed checkbox field in order to move those items to the bottom of the search results. I am applying (positive) boosting to other fields as well which precludes me from simply ordering my results by the discontinued field.

I am indexing the checkbox field as a string, as I believe this may be necessary in order to use boosting on this indexing field. I'm not certain of this though.

My method for adding negative boost predicates is below:

private IQueryable<IndexedItem> AddUnboostingPredicates(IQueryable<IndexedItem> queryable)
    return queryable.Where(item => item["discontinued"].Equals("1").Boost(-1000)
                                       || item["discontinued"].Equals("0"));

This code results in the error message

{"error":{"code":"","message":"Failed to parse query string at line 1, column 70. See https://aka.ms/azure-search-full-query for supported syntax."}}

Looking at search.log file I believe this is the offending part of the query expression sent to Azure:

(product_discontinued:(1)^-1000 OR product_discontinued:(0))

1 Answer 1


Azure Search does not seem to support negative boost values, as indicated here.

To boost a term use the caret, "^", symbol with a boost factor (a number) at the end of the term you are searching. You can also boost phrases. The higher the boost factor, the more relevant the term will be relative to other search terms. By default, the boost factor is 1. Although the boost factor must be positive, it can be less than 1 (for example, 0.20).

  • Do you know if a (positive) value less than 1 has the same effect as boosting? Oct 3, 2018 at 13:24
  • I'm not sure about that. Oct 4, 2018 at 9:30
  • 1
    I can confirm that it doesn't. With azure search, you just have to adjust all your boost values accordingly instead of using negative ones. Oct 4, 2018 at 22:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.