Get count of matched word/token in result.

Maciej Skuratowski 1 Reputation point
2021-08-23T05:42:57.397+00:00

Hi,

Imagine that I have for example the following searchable fields like Name, Content, Extra.

Let's say I send a query that contains 3 words like "Docking Station y255"

I would like to know if it is possible to get information on how many of each token ("Docking", "Station" "y255") was found in the index?
For instance:

  • Docking: (3x Name, 2x Content, 0x Extra)
  • Station: (0x Name, 3x Content, 0x Extra)
  • y255: (0x Name, 0x Content, 3x Extra).

I would like to know how the search score is built on because I would like to set my Azure Cognitive Search configuration to get the best results from a user perspective.

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.
727 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. SnehaAgrawal-MSFT 18,366 Reputation points
    2021-08-24T10:31:47.917+00:00

    Thanks for asking question! You may want to know that Azure Cognitive Search uses a default scoring algorithm to compute an initial score, but you can customize the calculation through a scoring profile.

    Scoring profiles are embedded in index definitions and include properties for boosting the score of matches, where additional criteria found in the profile provides the boosting logic. For example, you might want to boost matches based on their revenue potential, promote newer items, or perhaps boost items that have been in inventory too long.

    Check this article on Similarity and scoring in Azure Cognitive Search which describes the two similarity ranking algorithms used by Azure Cognitive Search to determine which matching documents are the most relevant to the query.

    This also introduces two related features: scoring profiles (criteria for adjusting a search score) and the featuresMode parameter (unpacks a search score to show more detail).

    featuresMode parameter is in preview which can provide additional detail about relevance at the field level. Through featuresMode you can get information about individual fields, as expressed in a @検索君 .features structure.

    For each field, you get the following values:
    • Number of unique tokens found in the field
    • Similarity score, or a measure of how similar the content of the field is, relative to the query term
    • Term frequency, or the number of times the query term was found in the field

    Let us know if you have further query or issue remains.