ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
[TOC] ## 创建索引 > 虽然您不需要手动创建索引,因为索引是在您开始摄取数据时自动创建的,但是您可以使用此API提前创建索引。 `POST http://localhost:4080/api/index` ``` { "name": "article", "storage_type": "disk", "shard_num": 1, "mappings": { "properties": { "title": { "type": "text", "index": true, "store": true, "highlightable": true }, "content": { "type": "text", "index": true, "store": true, "highlightable": true }, "status": { "type": "keyword", "index": true, "sortable": true, "aggregatable": true }, "publish_date": { "type": "date", "format": "2006-01-02T15:04:05Z07:00", "index": true, "sortable": true, "aggregatable": true } } }, "settings": { "analysis": { "analyzer": { "default": { "type": "standard" }, "my_analyzer": { "tokenizer": "standard", "char_filter": [ "my_mappings_char_filter" ] } }, "char_filter": { "my_mappings_char_filter": { "type": "mapping", "mappings": [ ":) => _happy_", ":( => _sad_" ] } } } } } ``` ## 删除索引 ``` DELETE http://localhost:4080/api/index/indextodelete ```