我一直在使用ElasticSearch DSL python包来查询我的elastic search数据库。查询方法非常直观,但是我在检索文档时遇到了问题。这是我尝试过的:
from elasticsearch import Elasticsearch
from elasticsearch_dsl import Search
es = Elasticsearch(hosts=[{"host":'xyz', "port":9200}],timeout=400)
s = Search(using=es,index ="xyz-*").
我有一个Ubuntu16.04的新安装,我在它上安装了elasticsearch 5。现在,当我尝试启动elasticsearch时,请使用
/etc/init.d/elasticsearch start
在日志文件中的几秒钟之后,我读到:
[2016-11-19T08:47:31,442][ERROR][o.e.b.Bootstrap ] [shooter-1] node validation exception
bootstrap checks failed
max number of threads [1891] for user [elasticsearch] lik
我正在尝试使用elasticsearch-spark连接器查询elasticsearch,我只想返回几个结果:
例如:
val conf = new SparkConf().set("es.nodes","localhost").set("es.index.auto.create", "true").setMaster("local")
val sparkContext = new SparkContext(conf)
val query = "{\"size\":1}"
print
早上好,
我需要将这个旧的查询(Exalead)转换为Elasticsearch:
"One Sentence" NEAR Word
我试过:
"One Sentence" AND "Word"~16
但是,它将此查询解释为:
"One Sentence" AND "Word"
“一句”与“字”之间的距离超过16个字。
那么我如何使用query_string_query进行这个查询呢?
我正在下面的文档中测试dis_max查询:
PUT /blog/post/1
{
"title": "Quick brown rabbits",
"body": "Brown rabbits are commonly seen."
}
PUT /blog/post/2
{
"title": "Keeping pets healthy",
"body": "My quick brown fox eats rabbits on a regula
我正试图在Elasticsearch 2.4上一下子删除一个简短的文档列表,但我似乎不能给它一个查询,导致>0个文档被删除。
id_list = ["AWeKNmt5qJi-jqXwc6qO", "AWeKT7ULqJi-jqXwc6qS"] #example
# The following does not delete any document (despite these ids being valid)
delres = es.delete_by_query("my_index", doc_type="my_doctype