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