ES基础四 in查询和between


 
 

POST /forum/article/_bulk
{ "update": { "_id": "1"} } { "doc" : {"tag" : ["java", "hadoop"]} } { "update": { "_id": "2"} } { "doc" : {"tag" : ["java"]} } { "update": { "_id": "3"} } { "doc" : {"tag" : ["hadoop"]} } { "update": { "_id": "4"} } { "doc" : {"tag" : ["java", "elasticsearch"]} }


GET /forum/article/_search { "query": { "constant_score": { "filter": { "terms": { "articleID": [ "KDKE-B-9947-#kL5", "QQPX-R-3956-#aD8" ] } } } } }


GET /forum/article/_search
{
"query": {
"constant_score": {
"filter": {
"terms": {
"tag": [
"java",
"elasticsearch"
]
}
}
}
}
}




terms字段后面必须是数组

 

GET /forum/article/_search
{
  "query": {"constant_score": {
    "filter":  {
      "range": {
        "view_cnt": {
          "gte": 40,
          "lte": 60
        }
      }
    }
  }}
}

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM