Filter on Collection(Edm.String) type fields in Azure Search


March 2019


6 time


I have an index that has an Collection(Edm.String) type field as below which is facetable and filterable.

Index definition

But when I do a query with the payload as below for filtering: {
"count": true,
"search": "Not able to connect to Azure SQL database",
"searchFields": "Content,keyphrases",
"select": "keyphrases", "facets": ["Source, sort:count", "SubSource, sort:count"], "filter": "keyphrases/any(t:, 'sql server database'))", "top": 6 }

I see results like this, where keyphrases don’t even have the full value “'sql server database”. Why is this so? How does filter work on collection types in Azure Search? How do I do an exact filter?

"value": [
        "@search.score": 0.9469998,
        "keyphrases": [
            "windows azure",
            "sql azure",
            "web application",
        "@search.score": 0.7976283,
        "keyphrases": [
            "Entity Framework Code",
            "base tables",
            "SQL Azure",
            "one-to-one mapping",
            "large numbers of tables",
            "partitioned view",
            "simple POCO",
            "typical partitioning",
            "horizontal partitioning strategy",
            "CHECK CONSTRAINTs",
            "DbContext class",
            "OnModelCreating event",
            "file groups",
            "Fluent API",


1 answers


Это сработало:

"Кол": правда,
"поиск": "Не может подключиться к базе данных Azure SQL",
"searchFields": "Содержание, фразы",
"выберите": "фразы", "фасеты": [ "Источник, сортировка: рассчитывать», "вспомогательный источник, сортировать: рассчитывать"], "фильтр": "фразы / любые (т: т э 'базы данных сервера SQL')", "верх": 6