Azure cognitive search scores longer matches higher

jron1001 20 Reputation points
2023-09-04T15:16:02.33+00:00

I have an fashion index set up for products that gets created with different keyword types and I can then score the products based on the more important word types e.g

Product Name = FOREVER NEW FORMAL COAT IN CREAM-WHITE

Product Type Keywords = FORMAL COAT

Attribute Keywords = CREAM, WHITE

This works well to to boost the score of the product type words over the attribute words and to ignore other words in the product name.

However, it seems to score products with longer product names higher e.g..

If I search for "FOREVER NEW FORMAL COAT IN CREAM-WHITE"

the results I get back are:

1st - FOREVER NEW PETITE FORMAL COCOON COAT IN CREAM-WHITE

2nd - FOREVER NEW CURVE LONGLINE RELAXED FORMAL COAT IN CREAM-WHITE

3rd - FOREVER NEW FORMAL COAT IN CREAM-WHITE

Is there anyway to stop the longer product names scoring higher as I want the 3rd option to be 1st as its more precise?

Azure AI Search
Azure AI Search
An Azure search service with built-in artificial intelligence capabilities that enrich information to help identify and explore relevant content at scale.
1,362 questions
{count} votes

1 answer

Sort by: Most helpful
  1. brtrach-MSFT 17,746 Reputation points Microsoft Employee Moderator
    2023-09-09T02:24:01.1666667+00:00

    @jron1001 Azure Cognitive Search uses a scoring algorithm called BM25 to rank search results. BM25 is a frequency-based scoring algorithm that takes into account the frequency of query terms in the document and the inverse document frequency of the query terms across the entire index.

    In general, longer documents tend to score higher because they have more opportunities to match query terms. However, you can adjust the scoring algorithm to better suit your needs.

    One way to do this is to use scoring profiles. Scoring profiles allow you to adjust the relevance score of search results based on specific criteria. For example, you could create a scoring profile that boosts the relevance score of documents that match on the product type keywords more than documents that match on the attribute keywords.

    Another way to adjust the scoring algorithm is to use term boosting. Term boosting allows you to assign a higher weight to specific query terms. For example, you could assign a higher weight to the product type keywords than to the attribute keywords.

    Keep in mind that adjusting the scoring algorithm can have unintended consequences, so it's important to test your changes thoroughly to ensure that they produce the desired results.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.