简体   繁体   中英

running elasticsearch queries on linux

What 's the correct way of running elasticsearch queries on linux? I came up with the code below but it seems that it is not correct because of many errors that I see.

curl -X GET http://localhost:9200/INDEXED_REPOSITORY/_search?q="constant_score" : {"filter" : { "terms" : { "description" : ["heart", "cancer", and  more than 10000 keywords ]}}}}

You're missing a few things, do it like this:

curl -X GET http://localhost:9200/INDEXED_REPOSITORY/_search -d '{
  "query": {
    "constant_score": {
      "filter" : { 
        "terms" : { 
          "description" : ["heart", "cancer", and  more than 10000 keywords ]
        }
      }
    }
  }
}'

or on a single line:

curl -X GET http://localhost:9200/INDEXED_REPOSITORY/_search -d '{"query": {"constant_score": {"filter" : {"terms" : {"description" : ["heart", "cancer", and  more than 10000 keywords ]}}}}}'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM