match query:
- 会对查询语句进行分词,可以匹配分词后的任一词项
如分词后可以匹配大小写等格式(由该字段的分词类型决定),但term只能精准匹配词项
【获取当前索引下的所有文档】
GET /test_data_type/_search
等同于:
GET /test_data_type/_search
{
"query": {
"match_all": {}
}
}
返回值:
"hits": {
"total": 243, //匹配的文档总数
"max_score": 8.897254, //匹配到文档的最高分
"hits": [
{
"_index": "shakespeare", //索引名
"_type": "line", //type
"_id": "44522", //文档id
"_score": 8.897254, //匹配分值
"_source": {
"line_id": 44523,
"play_name": "King John",
"speech_number": 15,
"line_number": "3.1.115",
"speaker": "CONSTANCE",
"text_entry": "War!