My issue is that when we do a first name search using a fuzzy search(with a distance of 2 characters on the first name) it doesn’t seem to bring back all possibilities.
QueryType is Full
QueryString - "FirstName:gra~2 AND (LastName: \"*****\" OR LastName: /.*\"*****\".*/)"
I'm using an exact match OR a contains on the lastname for this example, this will stay constant across the examples
Results:
If I search FirstName:gre~2 in an Azure Search query string we get back:
Greg
Gary
Gene
If I search FirstName:gra~2 we get back:
Gina
Gary
If I search FirstName:grag~2 we get back:
Greg
Gary
We know that azure fuzzy search uses the damerau-levenshtein distance and it seems like from “gra” both “gina” and “greg” would be 2 characters difference, yet only one is showing up. Also "grag" in theory should return "gina" as well
I'm wondering if anyone has an explanation for this since it seems inconsistent
I used this to verify the "distance" between the strings "gra" and "greg"&"gina"
http://fuzzy-string.com/Compare/
Here's the link to the azure documentation on Lucene Syntax
https://docs.microsoft.com/en-us/azure/search/query-lucene-syntax
These are both of the field definitions
{
"name": "FirstName",
"type": "Edm.String",
"searchable": true,
"filterable": true,
"retrievable": true,
"sortable": true,
"facetable": false,
"key": false,
"indexAnalyzer": null,
"searchAnalyzer": null,
"analyzer": "standard.lucene",
"synonymMaps": []
},
{
"name": "LastName",
"type": "Edm.String",
"searchable": true,
"filterable": true,
"retrievable": true,
"sortable": true,
"facetable": false,
"key": false,
"indexAnalyzer": null,
"searchAnalyzer": null,
"analyzer": "standard.lucene",
"synonymMaps": []
}
**Results seem to be the same regardless of lastname being used or not