es api

137 阅读1分钟

ES 常用API

cat

1641528528(1).png

cluster

1641529940(1).png

search

search后面可以跟url参数,也可以es自己的查询结构体

  1. url参数查询

  2. query match查询(match all,match,match_phrase,match_phrase_prefix)

  3. query_string查询(fields和query,单个查询default_field)

  4. match(keyword会精准查询,text会分词)模糊查询会分词,term精确查询不会分词

  5. bool查询(分为 must,fliter必须满足条件,should满足一个就行)

  6. index操作是针对整个索引的

    1. 可以自动创建 id PUT clothes/doc { "name":"test", "value":"test" },也可以指定)。
    2. 可以更新索引 PUT clothes/_create/6 { "name":"test", "value":"test" }需要指定id,post和put的区别,put必须要指定id才行,而且put是幂等性的,put更新是直接将更新的内容覆盖,而put是只更新要改的内容。

1641532626(1).png