摘要: 一、es的使用 1、检索文档: 想要从Elasticsearch中获取文档,我们使用同样的 _index 、 _type 、 _id ,但是HTTP方法改为 GET : GET /{index}/{type}/{id}?pretty 这里pretty的作用:在任意的查询字符串中增加 pretty 参 阅读全文
posted @ 2019-11-28 16:03 睡觉了嘛 阅读(433) 评论(0) 推荐(0) 编辑
摘要: 一、es中文档的元数据包括: 1、_index: 索引(index)类似于关系型数据库里的数据库(database),事实上,我们的数据被存储和索引在分片(shards)中,索引知识把一个或多个分片分组在一起的逻辑空间, 索引名字必须全部小写,不能以下划线开头,不能包含逗号。 2、_type: 类型 阅读全文
posted @ 2019-11-28 16:01 睡觉了嘛 阅读(1483) 评论(0) 推荐(0) 编辑
摘要: 1、为null或者不存在 db.test.find({"test":null}); 2、不为null并且存在记录 db.test.find({"test":{"$ne":null}}); db.test.find({"test":{"$ne":null, $exists:true}}); 3.存在 阅读全文
posted @ 2019-11-28 15:57 睡觉了嘛 阅读(150) 评论(0) 推荐(0) 编辑
摘要: import pymongo import math from elasticsearch import Elasticsearch from elasticsearch import helpers import time HOST = ['ip:端口'] es = Elasticsearch(H 阅读全文
posted @ 2019-11-28 15:52 睡觉了嘛 阅读(309) 评论(0) 推荐(0) 编辑