GET请求正文:

curl -XGET "http://localhost:9200/app/users/_search" -d '{ "query": { "term": { "email": "foo@gmail.com" } } }'

POST请求正文:

由于并非所有客户端都支持使用正文GET,因此也允许使用POST。

curl -XPOST "http://localhost:9200/app/users/_search" -d '{ "query": { "term": { "email": "foo@gmail.com" } } }'

GET没有请求正文:

curl -XGET "http://localhost:9200/app/users/_search?q=email:foo@gmail.com" 或(如果您想手动对您的查询字符串进行URL编码)

curl -XGET "http://localhost:9200/app/users/_search?q=email%3Afoo%40gmail.com"

参考 :http://www.elasticsearch.org/guide/reference/api/search/uri-request/

 

相关文章:

  • 2021-06-29
  • 2022-12-23
  • 2022-02-09
  • 2022-12-23
  • 2021-08-23
  • 2021-10-29
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-11-01
  • 2022-12-23
  • 2021-05-08
  • 2021-04-09
  • 2021-11-19
  • 2021-10-17
相关资源
相似解决方案