Search code examples
azureazure-cognitive-searchazure-search-.net-sdk

Which columns should be indexed in Azure search?


Help me understand the concept a little bit,

As per documentation:

In Azure Cognitive Search, a search index is your searchable content

If I have to make entire SQL table searchable then does it mean all the columns should be defined as indexable?


Solution

  • If I have to make entire SQL table searchable then does it mean all the columns should be defined as indexable?

    Technically yes, you would need to make all columns indexable (searchable) caveat being the field data type supports searching (currently Edm.String and Collection(Edm.String)).

    In fact, Azure Search does not even allow you to set a field as searchable if the data type of such field is not either Edm.String or Collection(Edm.String).

    You should also identify the columns on which you would want to filter the data (typically columns containing boolean, date/time or numerical data) and set filterable property as true for those columns.

    You should do this exercise to keep your index size small.

    Please see this link for more details on index fields: https://learn.microsoft.com/en-us/rest/api/searchservice/create-index#-field-definitions-.