3
votes

Using Azure Search, I'm struggling to combine fuzzy search with custom scoring profile.

If I search without fuzziness, the score is calculated properly. If I add fuzziness to search query it looks like my custom rules are not applied.

Example scenario (api-version=2015-02-28)

Create new Index (C# SDK 1.1):

Name = "SomeName",
Fields = new[]
{
  new Field("Title", DataType.String) { IsSearchable = true},
  new Field("Author", DataType.String) { IsSearchable = true}
}
ScoringProfiles = new List<ScoringProfile>
{
  new ScoringProfile()
  {
    Name = "SomeScoringProfile",
    TextWeights = new TextWeights()
    {
      Weights = new Dictionary<string, double>
      {
        ["Title"] = 200,
        ["Author"] = 10
      }
    }
  }  
}

Queries (in Azure Portal, I'm using Lucene syntax) I've created two documents, one has Title= Matrix, another Author= Matrix.

Query without fuzziness

&queryType=full&search=Title:Matrix OR Author:Matrix&scoringProfile=SomeScoringProfile

Score result: Document with Title: 0.11, Document with Author: 0.011

Query with fuzziness

&queryType=full&search=Title:Matrix~2 OR Author:Matrix~2&scoringProfile=SomeScoringProfile

Score result: Document with Title: 0.15, Document with Author: 0.15 (the same !)

Can you help me with trying to figure out what is wrong with this example ? Can this functionality be achieved with a different technique ?

1
Seems kinda strange. What happens if you just use boosts in the query string itself, like: &queryType=full&search=Title:Matrix~2^200 OR Author:Matrix~2^10&scoringProfile=SomeScoringProfilefemtoRgon
@femtoRgon that's what I've tried initially. It wasn't working either. Then I've discovered scoring profile and tried thatTomasz Gawlik
@tomasz.salieri We need a bit more info to reproduce this problem. Can you please contact my colleague Nate Ko? His email is nateko at Microsoft dot com.Bruce Johnston
@BruceJohnston I've wrote him an email. Thanks !Tomasz Gawlik
@BruceJohnston do you think I could try some different form of communication ? Still no response - I could wait, just need to know if someone will help me :) ThanksTomasz Gawlik

1 Answers

0
votes

Unfortunately, after an offline communication with you, I've confirmed that there is a bug in applying boosting weights for fuzzy searches. I will update the thread as soon as we have a fix.

I apologize for the inconvenience. Thanks for the detailed writeup.

Nate