查看索引
GET /_cat/indices
查看某个索引的mapping
GET /{index}/_mapping
创建索引索引名称:chat_data
PUT /{index}
{
"mappings": {"properties": {
"emb":{
"type": "dense_vector",
"dims": 768
},
"start_time": {"type": "date", "format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis"},
"end_time": {"type": "date", "format":"yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis"},
"users": {"type": "keyword"},
"raw_chat": {"type": "object","enabled": false},
"formate":{"type": "text", "index": false}
}}
}
删除索引
chat_data是索引名
DELETE {index}
分词分析
GET /{index}/_analyze
{
"text": "电视质量问题保修办法"
}
query分析
1对N
针对query的命中结果进行打分分析
GET /{index}/_search?explain=true
{
"query": {
"bool": {
"must": [
{
"match": {
"query": "需要多少费用"
}
}
],
"filter": [
{
"term": {
"robot_id": "123"
}
}
]
}
}
}
1对1
对某一条具体记录的得分分析
GET /{index}/_explain/2S8-dYQBqXsJ3K89vTQa
{
"query": {
"bool": {
"must": [
{
"match": {
"query": "需要多少费用"
}
}
]
}
}
}