在linux

时间:2017-09-27 01:35:39

标签: linux elasticsearch

在linux上运行elasticsearch查询的正确方法是什么?我想出了下面的代码,但由于我看到很多错误,它似乎不正确。

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

1 个答案:

答案 0 :(得分:1)

你错过了一些事情,这样做:

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 ]}}}}}'