繁体   English   中英

查询字符串在Elasticsearch扫描和滚动搜索中不起作用

[英]query string doesn't work in elasticsearch scan&scroll search

当我尝试:

curl -XPOST 'http://localhost:9200/index/type/_search?search_type=scan&scroll=2m' -d '{"query": {"match": {"host":"xxxx"}}}'

我有一个scroll_id 然后我发出:

curl -XPOST 'http://localhost:9200/_search/scroll?scroll=1m&scroll_id=......'

但是响应中包含属于其他主机的日志。 为什么以及如何解决?

非常感谢

尝试使用字词查询而不是匹配项:

{"query": {"term": {"host":"xxxx"}}}

这将查找确切的值,而不是分析您对于xxxx的值,并且有关差异的讨论是: https : //www.elastic.co/guide/en/elasticsearch/guide/current/term-vs-full- text.html

如果这不起作用,也可能是该字段正在被分析,并且映射也需要更新。 您可以共享索引的映射并输入: http:// localhost:9200 / index / _mapping / type /?pretty吗?

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM