Index management

Updated at:

Index management in OpenSearch covers how index schemas define field types for search and filtering, how composite indexes span multiple fields, how analyzers process text and vector data, and how attribute fields support filter, sort, aggregate, and distinct operations.

Index schema

An index schema defines how OpenSearch stores and retrieves your data. It consists of two types of fields:

  • Index fields — analyzed during indexing and searched at query time. Use these for full-text and keyword searches.

  • Attribute fields — used in filter, sort, aggregation, and distinct clauses.

Field type compatibility

The following table shows which field types support indexing, attribute configuration, or both.

Field type

Index field

Attribute field

Primary use

INT

Yes

Yes

Integer values; range search and filtering

INT_ARRAY

Yes

Yes

Arrays of integers

FLOAT

No

Yes

Floating-point values; sorting and aggregation only

FLOAT_ARRAY

No

Yes

Arrays of floats

DOUBLE

No

Yes

High-precision decimals; sorting and aggregation only

DOUBLE_ARRAY

No

Yes

Arrays of doubles

TEXT

Yes

No

Long-form text; full-text search with analyzer

SHORT_TEXT

Yes

No

Short strings; keyword and fuzzy search

LITERAL

Yes

Yes

Exact-match strings; filtering and search

LITERAL_ARRAY

Yes

Yes

Arrays of exact-match strings

TIMESTAMP

Yes

Yes

Time values; range search and time-based filtering

GEO_POINT

Yes

Yes

Geographic coordinates; location-based search

Composite index

A composite index spans multiple TEXT or SHORT_TEXT fields. Unlike querying multiple single-field indexes with OR, a composite index treats the combined content of all its fields as a single searchable unit, so a query term that spans across fields can be matched.

Consider an application with these indexes:

  • title_index — index on the title field

  • body_index — index on the body field

  • union_index — composite index on both title and body

Given this document:

id:123456,title:开放,body:搜索
# Querying two separate indexes with OR does not match the document.
query=title_index:'开放搜索' OR body_index:'开放搜索'

# Querying the composite index matches the document.
query=union_index:'开放搜索'

The term 开放搜索 cannot be found in either field alone, but the composite index finds it by searching across both fields together.

Note

All fields in a composite index must be of the same type — either all TEXT or all SHORT_TEXT. Mixing types is not supported.

The built-in default index can contain only fields of the TEXT type.

Analyzer types

Text analyzers

Text analyzers: Text analyzers segment text for retrieval across the following domains: Chinese, English, general industry, IT, e-commerce, and education. They also support:

  • Exact search by numeric or fixed-length value

  • Fuzzy search

  • Range search by location, time range, or numerical range

Vector analyzers

Vector analyzers retrieve documents based on multi-dimensional vectors. Two configurations are available:

  • General industry: retrieves documents based on multi-dimensional vectors

  • Education: retrieves general documents based on 256-dimensional vectors

Exact match without tokenization

To make a field match exactly without tokenization, submit an offline change to set the field type to LITERAL and set its analyzer to Keyword Analyzer. With Keyword Analyzer, the entire field value is treated as a single token, so queries against the field require an exact match instead of a tokenized match.

Because changing a field type is not available in the console, this configuration must go through the offline change process. The field cannot take effect immediately after saving.

You can also avoid tokenization in other scenarios:

  • To avoid tokenization for only part of a field's content, use a custom analyzer together with intervention entries and disable secondary tokenization. See Custom analyzers.

  • To avoid tokenization for an entire query term, wrap the term in double quotation marks, for example, query=default:"开放搜索". See Index recall - query clauses.

Multimodal embedding analysis

Multimodal embedding analysis provides vector retrieval for mixed text and image content. When you select a multimodal embedding analyzer, such as qwen3_vl_embedding_2560d or ops_mm_embedding_ecom_001, the included fields display all modalities that the analyzer supports.

Explicitly specify a modality for each included field, and provide one field for each modality. For example, assign the text modality to the text field title and the image modality to the image field img_url.

Important
  • Multimodal embedding analysis is available only for dedicated applications.

  • The included fields of a multimodal embedding index support only the TEXT and SHORT_TEXT types.

  • The included fields of a multimodal embedding index must be in the same data source table.

When you create an application, use searchFields in the index configuration of the application schema to specify the multimodal analyzer and its included fields. The following example shows the searchFields configuration:

{
  "searchFields": {
    "vector": {
      "analyzer": "qwen3_vl_embedding",
      "fields": [
        "title",
        "img_url"
      ]
    }
  }
}

In cluster.vectorIndexConfigs, use sourceFields to specify the modality for each source field:

{
  "cluster": {
    "vectorIndexConfigs": [
      {
        "indexName": "vector_index1",
        "namespace": "",
        "indexType": "Qc",
        "distanceType": "SquaredEuclidean",
        "sourceFields": [
          { "fieldName": "title", "modality": "text" },
          { "fieldName": "img_url", "modality": "image" }
        ]
      }
    ]
  }
}

Take note of the following parameters in the preceding example:

  • modality: the field modality. Valid values: text and image.

  • indexType and distanceType default to Qc and SquaredEuclidean, respectively.

Attribute fields

Attribute fields support the following clauses:

Clause

Purpose

filter

Filter results by field value. Example: filter=id>100000

aggregate

Compute statistics over a field

sort

Order results by field value

distinct

Deduplicate results based on a field