Modify/Create new azure ai search index with "IMPORT AND VECTORIZE DATA" option and configure some fields as facetable, sortable

Rikin 20 Reputation points
2025-04-02T18:17:46.4233333+00:00

Hey Azure Community,

I want to ask you a question in regards of azure ai search. Actually I am not able to make any fields facetable, sortable, etc when I try to create indexes using "IMPORT AND VECTORIZE DATA" option.

Can you please guide me how to make some fields facetable, sortable while creating a new indexes using "IMPORT AND VECTORIZE DATA" option.

If I try to create index using "IMPORT DATA" option I am able to configure fields but I do not want to use traditional (text) based search index. I want to make index which uses semantic+vector search.

Thanks.

Azure AI Search
Azure AI Search
An Azure search service with built-in artificial intelligence capabilities that enrich information to help identify and explore relevant content at scale.
1,283 questions
{count} votes

Accepted answer
  1. Siva Nair 1,475 Reputation points Microsoft External Staff
    2025-04-04T06:01:06.69+00:00

    Hi Rikin,

    The "Import and Vectorize Data" option auto-generates fields optimized for AI search and doesn't allow customization. Manually defining the schema before indexing gives you full control over facetable, sortable, and filterable attributes.

    To achieve it we should manually create the index and then link it to a data source.

    Navigate to Azure AI Search → Indexes → "Create Index" and define your index schema manually. When configuring the fields, ensure that you set the necessary attributes: facetable as true for filtering and grouping, sortable as true for ordering results, filterable as true for using in $filter queries, and retrievable as true if you want the field to appear in search results. Additionally, for vector search, define a field of type Collection(Edm.Single) and attach a vectorSearchConfiguration.

    Once the index is created, you need to manually attach a data source (such as Azure Blob Storage, Cosmos DB, or SQL Database) and configure an indexer to populate the index. Unlike the automated process in "Import and Vectorize Data," this approach allows you to fine-tune the schema while still benefiting from semantic+vector search.

    {
      "name": "my-search-index",
      "fields": [
        {
          "name": "id",
          "type": "Edm.String",
          "key": true,
          "retrievable": true
        },
        {
          "name": "title",
          "type": "Edm.String",
          "retrievable": true,
          "sortable": true,
          "facetable": true
        },
        {
          "name": "category",
          "type": "Edm.String",
          "filterable": true,
          "facetable": true
        },
        {
          "name": "contentVector",
          "type": "Collection(Edm.Single)",
          "searchable": true,
          "vectorSearchConfiguration": "default"
        }
      ],
      "vectorSearch": {
        "algorithms": [
          {
            "name": "default",
            "kind": "hnsw",
            "parameters": {
              "m": 4,
              "efConstruction": 400
            }
          }
        ]
      }
    }
    

    If you have any further assistant, do let me know.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.