I need to suggest a list of users in a dropdown by FirstName, LastName, and Email I have created an index marking the fields with the suggester in the azure console as follows:
This only works for a query by the FirstName but not for FirstName "space" LastName, when I run this query I just get 0 documents
Example:
Name John Doe
- John, I get suggestions for all Johns
- John , I get suggestions for all Johns
- John D, I get 0 documents
- John Doe, I get 1 document
This is my code:
term = Uri.EscapeDataString(term);
SuggestParameters sp = new SuggestParameters
{
Top = 20,
UseFuzzyMatching = true,
SearchFields = new List<string> { "FirstName", "LastName","Email" },
Select = new List<string> { "Id","FirstName", "LastName", "Email" },
OrderBy = new List<string> { "FirstName", "LastName", "Email" },
};
var docs = await _indexClient.Documents.SuggestAsync(term, "sg", sp);
- Can I split the query by terms like one to be the FirstName and the second one to be the LastName?
- Do I need to scape the term in a different way?
- Is there any wildcard I can use to have a similar behavior like a Like expresion in SQL?
Any help will be appreciated