1.增  参考:https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping.html

  PUT mytest01/external/
{
"name": "xiaowei"
} curl -XPUT '192.168.1.49:9200/mytest/external/1?format=yaml' -H "Content-Type: application/json" -d '{"name":"paxi"}'

2.查

查看索引:curl -XGET http://192.168.1.49:9200/_cat/indices?pretty
GET mytest/_search/
{
"query": {
"match": {
"name": "paxi"
}
}
} curl -XGET 'http://192.168.1.49:9200/mytest/_search/' -H "Content-Type: application/json" -d '{
"query": {
"match": {
"name": "paxi"
}
}
}'

3.删除

curl -XDELETE http://192.168.1.49:9200/mytest01
参考:https://www.cnblogs.com/jing1617/p/8060421.html

4.查看mapping

 curl -XGET http://192.168.1.49:9200/mytest08/_mapping?pretty

5.查看settings

curl -XGET http://192.168.1.49:9200/mytest08/_settings?pretty

--------------------------------------------------------------------------------------

0.模糊查询好的例子

GET /my_index/my_type/_search
{
"query": {
"match": {
"title": {
"query": "quick~brow~",
"fuzziness": "AUTO",
"operator": "and"
}
}
}
}

参考: https://blog.csdn.net/u011262847/article/details/78007119

1.elasticsearch的devtool短语查询2019-07-18 11:30这个时间的日志document

GET /log47012/doc/_search
{
"query": {
"match_phrase": {
"localtime": "2019-07-18 11:30~"
}
}
}

2.kibana的discover的2019-07-18 11:30这个时间的日志document

localtime: "2019-07-18 11:30~"
"2019-07-18 11:30~" --> 相当于一个完整字符串
 

3.AND discover 查询

"2019-07-18 11:34" AND "中的配置项正在被初始化"

——————————————————————————————————————————

1.匹配符查询

# index a doc
PUT index/type/
{
"body": "here"
} # and get it ...
GET index/type/ ### get all index
GET _cat/indices ### get type
GET log4sys-2019.07./_search ### query target document
GET log4sys-2019.07./doc/_search
{
"query": {
"wildcard": {
"body": "*he?*e"
}
}
}

----------------------------------------------------------------------------------------------------------------------------------------------

1.查询在Query查询上下文和Filter过滤器上下文中,执行的操作是不一样的:

查询上下文:

在查询上下文中,查询会回答这个问题——“这个文档匹不匹配这个查询,它的相关度高么?”

2.

过滤器上下文:

在过滤器上下文中,查询会回答这个问题——“这个文档匹不匹配?”

复制自:https://www.cnblogs.com/xing901022/p/4975931.html

https://www.cnblogs.com/asker009/p/10174973.html

命令行查询

curl -X POST \
http://10.0.0.35:9200/addressbook_user/_search \
-H 'cache-control: no-cache' \
-H 'content-type: application/json' \
-d '{
"size": ,
"query": {
"bool": {
"must": [
{
"term": {
"userId": {
"value": "03a6cc5f1a6d4326a490ddf3547f3a1a",
"boost":
}
}
}
], "adjust_pure_negative": true,
"boost":
}
}
}'

最新文章

  1. linux 使用 nvidia 的 gpu
  2. matlab 按照某列以行为单位进行排序
  3. 新版react踩坑总结
  4. Mongoose简单的连表查询
  5. C#序列化JSON
  6. Sqlserver 角色那些事
  7. (VS) TFS lost mapping suddenly.
  8. Excel快捷键
  9. C/C++中虚函数的调用
  10. iOS在MRC工程环境下下使用ARC的方法
  11. JAVA byte有无符号数的转换
  12. hdu 4915 Parenthese sequence--2014 Multi-University Training Contest 5
  13. IIS配置PHP环境
  14. hadoop--安装1.2.1版本
  15. 下载的js文件本地编辑器打开中文乱码如何解决
  16. mysql 跨服务器复制数据库
  17. APPicon的生成
  18. [wiki]陶德曼调停
  19. 设计模式入门——Head First
  20. ubuntu 16.04 root 初始密码设置

热门文章

  1. mysql优化(下)
  2. 与word、excel交互问题总结
  3. [python](Docker SDK)上传镜像到私有仓库(tls、身份认证)
  4. maven项目创7 配置分页插件
  5. Windows:打印为PDF(PDF转换器)
  6. Windows下Yarn安装与使用
  7. Python 图形界面元素
  8. excel怎么只打印某页?excel怎么只打印某几页
  9. [SQL 高级查询运算符的用法 UNION (ALL),EXCEPT(ALL),INTERSECT(ALL) ]
  10. 使用Laravel首次运行出现 No application encryption key has been specified.