1. match_all
{ "match_all": {}} 匹配所有的, 當不給查詢條件時,默認。
2. match
進行full text search或者exact value(非string字段或not_analyzed的字段),進行匹配
3. multi_match
同時對多個字段進行同樣的match
{
"multi_match": {
"query": "full text search",
"fields": [ "title", "body" ]
}
}
4. range
對number或時間字段進行
{
"range": {
"age": {
"gte": 20,
"lt": 30
}
}
}
5. term
對字段進行確切值(exact value)的查詢,如數字、時間、bool、not_analyzed字段等。
{ "term": { "age": 26 }}
{ "term": { "date": "2014-09-01" }}
{ "term": { "public": true }}
{ "term": { "tag": "full_text" }}
6. terms
和term一樣, 不同的是,可以指定多個值來進行精確匹配
{ "terms": { "tag": [ "search", "full_text", "nosql" ] }}
7. exists/missing
用來查找某個字段是否有值, 類似SQL中的 not is_null/is_null
{
"exists": {
"field": "title"
}
}