0
votes

I have an azure search configured with many fields. Four of the fields are searchable (Field1, Field2, field3, field4) I want to rank my results so that if the match was found in field 1, I want those results displayed first. If the match was found in field2, I want those results displayed after the field1 matching results, but before the matching results from field3. etc

What scoring profile can I use to rank the results as above?

1

1 Answers

0
votes

While creating a scoring profile, you can assign specific weight to the individual fields by using the weights component. In your case you would assign a higher weight to field2 than field1.You can further specify functions to influence the scoring based on scenarios like freshness, magnitude etc.

"scoringProfiles": [  
    {  
      "name": "boostGenre",  
      "text": {  
        "weights": {  
          "field1": 1.5,  
          "field2": 25,  
          "field3": 2,  
          "field4": 3,  
        }  
      }  
    },  
    {  
      "name": "somefunction",  
      "functions": [  
         ...
      ]  
    }  
  ],  

You can more details about this here.