文档

Schema

更新时间:

描述

opensearch 应用的 schema

示例

{
    "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"
        ]
    }
}

结构

字段

类型

描述

tables

Object

表结构

tables.*

Object

表结构详情,具体说明查看下文Table*:表名

indexes

Object

索引结构,具体说明查看下文Index

Table

示例

{
    "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
        }
    }
}

结构

字段

类型

描述

fields

Object

字段结构

fields.*

Object

字段详情,具体说明查看下文Field*:字段名

primaryTable

Boolean

是否是主表

name

String

表名

Field

示例:

{
  "type": "INT",
  "name": "id",
  "primaryKey": true,
  "joinWith":["other_table"]
}

结构

字段

类型

描述

type

String

字段类型参考:数据表字段

name

String

字段名

primaryKey

Boolean

是否是主键

joinWith

Array

外表链接的数据表集合

Index

示例

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

结构

字段

类型

描述

filterFields

Array

属性字段集合

searchFields

Object

索引字段

searchFields.*

Object

索引字段详情,具体说明查看下文SearchField*:索引名称

SearchField

示例

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

结构

字段

类型

描述

fields

Array

索引字段集合

analyzer

String

可填写自定义分析器内置分析器名称

内置分析器

分析器

描述

chn_standard

中文-通用分析

simple

简单分析

chn_single

中文-单字分析

eng_standard

英文-去词根分析

eng_nostem

英文-不去词根分析

fuzzy

模糊分析

keyword

关键字

chn_ecommerce

中文-电商分析

chn_film

中文-视频分析

chn_scene_name

中文-人名分析

chn_scene_org

中文-机构名分析

first_letter

拼音-简拼分析

full_pinyin

拼音全拼分析

numeric

数值分析

geo

地理位置分析

chn_it_content

IT-内容分析

  • 本页导读 (0)
文档反馈