We have a search screen where the user can enter a phrase and then search Azure for rows that contain the phrase or any words of the phrase. They want to see the results ordered by the rows that contain the entire phrase first followed by rows that contain any or all of the words that make up the phrase.
This is my search string that I am testing with in Search Explorer in portal:
search="\"cause and healthcare\"" cause and healthcare&queryType=full&searchMode=any
So in this example they want to see rows that contain the phrase "cause and healthcare" first and then any rows that contain any/all of "cause" "and" "healthcare"
When I run the above query in the Search Explorer in Azure portal, it "seems" to return the rows with the entire phrase first followed by the others in no particular order. But I am getting a different order when I run from from dotNet:
SearchParameters parameters = new SearchParameters()
{
Filter = newFilter,
QueryType = QueryType.Full,
Top = recordsPerPage,
Skip = skip,
SearchMode = SearchMode.Any,
IncludeTotalResultCount = true
};
query = string.Format("\"{0}\" {0}", query);
I have looked at term boosting in the Search Explorer by putting ^2, ^4 etc. within the search string but that doesn't seem to have any impact.
Ideally I would like the rows that contain the entire phrase returned first, followed by rows that contain the first word, followed by rows that contain second word etc.
How can I change my code to ensure the rows are returned in the specified order?