All Products
Search
Document Center

OpenSearch:Schema

Last Updated:Jan 21, 2026

Description

The schema of an OpenSearch application.

Example

{
    "tables": {
        "main": {
            "primaryTable": true,
            "name": "main",
            "fields": {
                "id": {
                    "name": "id",
                    "type": "LITERAL",
                    "primaryKey": true
                },
                "title": {
                    "name": "title",
                    "type": "TEXT",
                    "primaryKey": false
                },
                "buy": {
                    "name": "buy",
                    "type": "INT",
                    "primaryKey": false
                },
                "cate_id": {
                    "name": "cate_id",
                    "type": "INT",
                    "primaryKey": false
                },
                "cate_name": {
                    "name": "cate_name",
                    "type": "LITERAL",
                    "primaryKey": false
                }
            }
        }
    },
    "indexes": {
        "searchFields": {
            "id": {
                "fields": [
                    "id"
                ]
            },
            "default": {
                "fields": [
                    "title"
                ],
                "analyzer": "chn_standard"
            },
            "cate_name": {
                "fields": [
                    "cate_name"
                ]
            }
        },
        "filterFields": [
            "id",
            "buy",
            "cate_id",
            "cate_name"
        ]
    }
}

Structure

Field

Type

Description

tables

Object

Table schema

tables.*

Object

For details about a specific table's schema, see the corresponding `Table*` section below.

indexes

Object

Index schema: For more information, see the Index section below.

Table

Example

{
    "primaryTable": true,
    "name": "main",
    "fields": {
        "id": {
            "name": "id",
            "type": "LITERAL",
            "primaryKey": true
        },
        "title": {
            "name": "title",
            "type": "TEXT",
            "primaryKey": false
        },
        "buy": {
            "name": "buy",
            "type": "INT",
            "primaryKey": false
        },
        "cate_id": {
            "name": "cate_id",
            "type": "INT",
            "primaryKey": false
        },
        "cate_name": {
            "name": "cate_name",
            "type": "LITERAL",
            "primaryKey": false
        }
    }
}

Structure

Field

Type

Description

fields

Object

Field structure

fields.*

Object

For field details, see the description below. `Field*` specifies the name of the field.

primaryTable

Boolean

Indicates whether the table is the primary table.

name

String

The name of the table.

Field

Example

{
  "name": "json_nested",
  "type": "NESTED",
  "primaryKey": false,
  "innerSchema": {
    "job": {
      "name": "job",
      "type": "TEXT",
      "primaryKey": false
    },
    "ssn": {
      "name": "ssn",
      "type": "LITERAL",
      "primaryKey": false
    }
  }
}

Structure

Field

Type

Description

type

String

The field type. For more information about fields, see Application schema.

name

String

The name of the field.

primaryKey

Boolean

Specifies whether the field is a primary key.

joinWith

Array

Collecting linked external data tables

innerSchema

Object

Specifies the data structure if the field type is OBJECT or NESTED. Nesting is supported.

Index

Example

{
    "searchFields": {
      "default": {
        "fields": [
          "title"
        ],
        "analyzer": "chn_standard"
      },
      "id": {
        "fields": [
          "id"
        ]
      }
    },
    "filterFields": [
      "id"
    ]
}

Structure

Field

Type

Description

filterFields

Array

The list of attribute fields.

searchFields

Object

Index field

searchFields.*

Object

The details of an index field. For more information, see the "SearchField" section of this topic. The asterisk (*) indicates the name of the index field.

SearchField

Example

{
  "fields": ["title"],
  "analyzer": "chn_standard"
}

Structure

Field

Type

Description

fields

Array

The list of index fields.

analyzer

String

The name of the analyzer, such as a custom analyzer or built-in analyzer. For more information, see Custom analyzers and Built-in analyzers.

Built-in analyzers

Analyzer

Description

chn_standard

Chinese: General Analysis

simple

Simple analysis

chn_single

The analyzer for single Chinese characters.

eng_standard

The analyzer for stemming English words.

eng_nostem

English - No Stemming

fuzzy

Fuzzy Analysis

keyword

Keyword

chn_ecommerce

China E-commerce Analysis

chn_film

Chinese Video Analysis

chn_scene_name

Chinese Personal Name Analysis

chn_scene_org

The analyzer for organization names in Chinese.

first_letter

The analyzer for simple pinyin spelling.

full_pinyin

The analyzer for full pinyin spelling.

numeric

Numerical Analysis

geo

Geolocation Analysis

chn_it_content

IT content analysis