Adam Jones
Adam Jones

Reputation: 63

Wildcard Syntax for Azure Search Simple Query Syntax

I am using the Azure Search C# SDK version 5.0.1. I am trying to perform a simple query that will search a field for a value that starts with something. It would be equivalent to the SQL query of Select * From mytable Where myproperty = 'val%'. According to the Simple Query Syntax documentation (located here) this should be possible using a wildcard. I cannot figure out how to get it working. I have tried to populate the Filter property of the SearchParameters in the following ways:

  1. "fieldname eq 'val*'" Doesn't work
  2. "fieldname eq 'val\.*'" Doesn't work
  3. "search.in(filename, 'val*')" Doesn't work

Does anyone know of a way to perform wildcard searches using Azure Search .NET SDK with simple query syntax?

Upvotes: 1

Views: 1531

Answers (1)

Bruce Johnston
Bruce Johnston

Reputation: 8634

Wildcards work in searches, not filters. You need to use it in the searchText parameter, not the Filter parameter.

Upvotes: 1

Related Questions