| 查询类型 | term(单值)/ terms(多值任一命中) |
|---|---|
| 匹配语义 | 查询词不做分析,直接查索引词条 |
| 附加选项 | case_insensitive(仅 keyword 类) |
示例
示例
GET /my-index/_search
{
"query": {
"term": { "user.id": { "value": "kimchy", "case_insensitive": true } }
}
}
GET /my-index/_search
{ "query": { "terms": { "status": ["open", "pending"] } } }要按前缀或子串模糊匹配,应使用 prefix、wildcard 或 match 查询,term 不承担这类能力。