es 基础命令
来源:互联网 发布:淘宝如何拉黑店铺 编辑:程序博客网 时间:2024/06/05 04:00
1.查看es下所有的东西 http://localhost:9200/_cat
2.查看es下所有的索引 http://localhost:9200/_cat/indices
3.查看索引bank的索引结构 http://localhost:9200/bank/
4.卸载x-package bin/elasticsearch-plugin remove x-pack
5.终端命令行查看索引情况 curl localhost:9200/_cat/indices?v'
7.put 有指定id post自动生成id
8.更新用post 支持脚本方式
9.排序 http://localhost:9200/bank/_search?q=*&sort=account_number:desc&pretty 字段account_number 按倒序排列。倒序desc 正序 asc
等同于:
GET http://localhost:9200/bank/_search
{
"query": { "match_all": {} },
"sort": [
{ "account_number": "desc" }
]
}
10.过滤加排序 http://localhost:9200/bank/_search?q=firstname:Bradshaw&sort=account_number:asc&pretty firstname是Bradshaw并且字段account_number 按倒序排列
11.结果集解释:
took – es执行搜索花费的时间(毫秒)
timed_out – 搜索是否超时
_shards – 告诉我们,多少分片被搜索,搜索时成功/失败的分片各多少。
hits – 搜索结果
hits.total – 匹配我们搜索条件的文档数量。
hits.hits – 实际搜索出的结果数组。(默认显示前10条)
hits.sort - 搜索出的排序
hits._score and max_score - 搜索匹配分数
12.我们可以在命令中端执行通过DSL方式去查询,可以通过 curl 'http://localhost:9200/bank/_search?pretty' --data-binary "@b.json",其中,--data-binary 参数可以执行本地DSL,注意执行该语句时,DSL文件(b.json)一定要在当前目录(bin目录下)
也可以通过以下方式:
curl -XGET 'localhost:9200/bank/_search?pretty' -H 'Content-Type: application/json' -d'
{
"query": { "match_all": {} }
}
'
- es 基础命令
- ES命令
- ES命令
- ES命令
- ES基础
- ffmpeg提取es命令
- es 常用curl命令
- es 命令查询
- OpenGL ES 绘图基础
- OpenGL ES 基础篇
- ES基础操作
- es模块化基础
- ES基础概念
- ES基础概念
- 10.8 es基础
- ES学习笔记基础
- ES命令集锦(很重要)
- Elasticsearch[es]的命令总结
- 工作中小细节总结(二)
- 缓冲流的特有方法复制文件
- Dialog中文文档
- 《@互联网人》-腾讯人自己拍的电影
- 安装Python版本的cairo模块:Pycairo
- es 基础命令
- Largest Rectangle in a Histogram
- javaWeb实现聊天室(私聊+群聊)
- iOS UIStackView UIStackViewDistribution UIStackViewAlignment
- springmvc常用注解
- 2017年百度之星编程赛初赛A场-1005-今夕何夕
- 把集合中的数据写到文本文件
- BeautifulSoup
- 把文本文件中的数据读取到集合