doc-parser-server/config/es/99-常用es语句.http
2025-06-09 12:50:12 +08:00

64 lines
1.1 KiB
HTTP

#{
# "keywordGroups": [
# ["Luke.Ye", "设计模式"],
# ]
#}
# 表示 (设计模式 AND Luke.Ye)
POST /documents/_search
{
"query": {
"bool": {
"should": [
{
"bool": {
"must": [
{ "multi_match": { "query": "设计模式", "fields": ["filename", "content"], "type": "phrase" }},
{ "multi_match": { "query": "Luke.Ye", "fields": ["filename", "content"], "type": "phrase" }}
]
}
}
],
"minimum_should_match": 1
}
},
"highlight": {
"pre_tags": ["<mark>"],
"post_tags": ["</mark>"],
"fields": {
"content": {
"fragment_size": 100,
"number_of_fragments": 3
},
"filename": {
"fragment_size": 100,
"number_of_fragments": 1
}
}
},
"sort": [
{ "mtime": "desc" }
],
"size": 10,
"from": 0
}
# 清空索引中的全部内容
POST /documents/_delete_by_query
{
"query": {
"match_all": {}
}
}
# 从索引中删除某个文件
POST /documents/_delete_by_query
{
"query": {
"match_phrase": {
"filename": "服务定位器模式"
}
}
}