资讯专栏INFORMATION COLUMN

ElasticSearch - API Conventions

ghnor / 2339人阅读

摘要:例如实际调用特殊字符要报文体省略转化为只获取字段且中字段,按中字段降序排序

Date math support in index names

Limiting the number of indices that are searched reduces the load on the cluster and improves execution performance.

form:

 

例如:
GET /,,/_search
实际调用特殊字符要encode:GET /%3Clogstash-%7Bnow%2Fd-2d%7D%3E%2C%3Clogstash-%7Bnow%2Fd-1d%7D%3E%2C%3Clogstash-%7Bnow%2Fd%7D%3E/_search
报文体省略

Common options

appending ?pretty=true to any request made, the JSON returned will be pretty formatted (use it for debugging only!).

"size_in_bytes": 1024 转化为 "size_in_bytes": "1kb" by adding ?human=true to the query string.

Response Filtering

GET /_cluster/state?filter_path=metadata.indices.*.stat*
Responds:
{
  "metadata" : {
    "indices" : {
      "twitter": {"state": "open"}
    }
  }
}   

the ** wildcard can be used to include fields without knowing the exact path of the field.

exclude one or more fields by prefixing the filter with the char -:

GET /_count?filter_path=-_shards 

both inclusive and exclusive filters can be combined in the same expression.

raw value of a field, like the _source field.

# 只获取hits.hits._source字段且_source中title字段,按_source中rating字段降序排序
GET /_search?filter_path=hits.hits._source&_source=title&sort=rating:desc

Enabling stack traces: url append error_trace=true

URL-based access control

elasticsearch.yml file:

rest.action.multi.allow_explicit_index: false

Elasticsearch will reject requests that have an explicit index specified in the request body.

文章版权归作者所有,未经允许请勿转载,若此文章存在违规行为,您可以联系管理员删除。

转载请注明本文地址:https://www.ucloud.cn/yun/68460.html

相关文章

  • JavaScript Style Guide and Coding Conventions

    摘要:点击查看原文总结一下变量名函数名用驼峰,以小写字母开头逗号和操作符之后要有空格缩进为个空格其实现在有很多是个的语句的结尾有分号复合语句左花括号在首行末尾,且之前有空格右花括号另起一行,之前没有空格结尾没有括号对象左花括号不换行,之前有空格 点击查看原文 总结一下: 变量名函数名用驼峰,以小写字母开头 逗号和操作符之后要有空格 缩进为4个空格(其实现在有很多是2个的 nodejs ...

    ormsf 评论0 收藏0
  • 从原理层面掌握@SessionAttribute的使用【一起学Spring MVC】

    摘要:见名之意,它是处理器,也就是解析这个注解的核心。管理通过标注了的特定会话属性,存储最终是委托了来实现。只会清楚注解放进去的,并不清除放进去的它的唯一实现类实现也简单。在更新时,模型属性与会话同步,如果缺少,还将添加属性。 每篇一句 不是你当上了火影大家就认可你,而是大家都认可你才能当上火影 前言 该注解顾名思义,作用是将Model中的属性同步到session会话当中,方便在下一次请求中...

    ARGUS 评论0 收藏0

发表评论

0条评论

最新活动
阅读需要支付1元查看
<