Search code examples
azureindexingazure-cognitive-searchsemantic-search

How is Semantic Search using fields set up in Semantic Configuration to re rank results in Azure Cognitive Search


I have an index in azure cognitive search where I have given the details of my offerings. There are two main fields (amongst many others like Name, Availability etc.):

Bio (Edm.String) Tags (Collection(Edm.String)) I have defined a scoring profile which gives the highest weight to a match present in Tags (weight :10) and Bio (weight:4) Now when I make a full text search (without Semantic search enabled) where the query includes a term which directly matches in 'Tags' field, I get the required results where the results which have a match in Tags and Bio on top, which is the expected behaviour. Now when I turn on the semantic search with the configuration below:

"semantic": {
    "defaultConfiguration": null,
    "configurations": [
      {
        "name": "semantic-config",
        "prioritizedFields": {
          "titleField": {
            "fieldName": "Name"
          },
          "prioritizedContentFields": [
           { 
             "fieldName":"Bio"
             }
           
              ],
          "prioritizedKeywordsFields": [
            {
              "fieldName": "Tags"
            }
          ]
        }
      }
    ]
 
 }

Now the results that I get are completely only the ones where the words are matching with the Bio, which is not what I want, I still want results which have a match in the Tags to be on top.

So I was wondering if My scoring profile is being considered for the re ranking scores or how do I make my Tags influence my semantic search and give me results like the one that I get in semantic search.


Solution

  • Semantic summarization and ranking are applied to just the top 50 results, as scored by the default scoring algorithm. Using those results as the document corpus, semantic ranking re-scores those results based on the semantic strength of the match. Therefore any scoring profiles used using the default scoring algorithm with simple or full queryTypes are overridden and not applicable when using Semantic as the reRankerscore's are used through the Semantic search models. We are currently working on composing scoring profiles for Semantic search queries.

    See https://learn.microsoft.com/en-us/azure/search/semantic-search-overview#how-semantic-ranking-works