我有一個查詢:Elasticsearch比較或
{
"query": {
"bool" : {
"must": [
{ "match": { "tags": "htc" } },
{ "match": { "votype" : 1} },
{ "match": { "subtype": 1 } },
{ "match": { "deleted": 0 } },
{ "match": { "build_status": 4 } },
{ "match": { "publish": 1 } }
]
}
},
"sort": [
{ "created": "desc" }
],
"size": 30,
"from": 0
}
,我想投入值
的值列表{ "match": { "votype": [1 or 2 or 3] } }
SQL模擬:
SELECT * FROM tablename WHERE type IN(1, 2);
但不`知道如何到
不工作:
{ "match": { "votype": [1,3] } },
{ "match": { "votype": "1 2" } },
{ "match": { "votype": "1OR2" } }
看一看的[條款查詢](http://www.elasticsearch.org/guide/reference/query-dsl/terms-query.html) – Thorsten 2013-02-19 17:05:07
是工作!感謝您的提示 – ahiipsa 2013-02-20 13:14:15