0

I am developing an Azure Function that makes a call to an Azure Search, gets the search results based on some keywords and then sends it back to the front end application. I have a searchable column in my Azure Search Data Source (an Azure Table). It contains comma separated string with keywords like

  • Digital, Technology, 3D
  • Digital, Technology, AR
  • Digital, Manufacturing, Chemicals
  • Digital, Manufacturing, Medicines

Now I wish to do a search as follows :

  • (Digital, Technology, 3D) OR (Digital, Manufacturing, Chemicals)

which should fetch me all record with column value as

  • Digital, Technology, 3D
  • Digital, Manufacturing, Chemicals

I am not able to implement this. I am aware of the SearchMode.Any and SearchMode.All but I am not able to find out how can I implement the OR between the above 2 groups.

1 Answers1

0

Since your goal is to query for exact matches, you should use an OData filter instead of a search query. You can do this using the .NET SDK like this (assuming your filterable field name is called 'Categories'):

string filter = "Categories eq 'Digital, Technology, 3D' or Categories eq 'Digital, Manufacturing, Chemicals'";
var params = new SearchParameters() { Filter = filter };
var result = indexClient.Documents.Search("*", params);
Bruce Johnston
  • 8,344
  • 3
  • 32
  • 42