#{ # "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": [""], "post_tags": [""], "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": {} } }