1
votes

The "Exact Search" fields use their own custom analyzer, while the Search fields use a language specific custom analyzer (built on MicrosoftStemmingTokenizerLanguage.French, for example).

I can't seem to use $filter for the "Exact Search" field, because $filter considers the entire field, and doesn't use the custom analyzer of the field.

Azure Search docs indicate this about field scoped queries. "You can specify a fieldname:searchterm construction to define a fielded query operation, where the field is a single word, and the search term is also a single word"

There is no clear way on how to do this in Azure. We know we can use the searchFields parameter in our Azure Search Rest API calls to target specific fields, but how do we search ALL fields for 1 term while specifically searching some fields for specific terms, basically doing an “AND” between them?

1

1 Answers

0
votes

This is possible using the Lucene query syntax.

Construct your query like this, where "chair" is the term to search for in all fields, and field1 and field2 are fields where you want to search for specific terms:

chair AND field1:something AND field2:else

In terms of how you use this in the REST API, just embed it in your search parameter. If you're using GET it looks like this (imagine it URL-encoded):

search=chair AND field1:something AND field2:else

If you're using POST, it goes in the request body and looks like this:

{
    "search": "chair AND field1:something AND field2:else",
    ... (other parameters)
}