【发布时间】:2017-06-01 16:13:43
【问题描述】:
可能由于我对 Elasticsearch(和 R 库 Elastic)缺乏经验,我无法弄清楚如何以精确匹配与通配符结合的方式来制定搜索查询。
docs_create(index="test",type="x", body=list(txt="this is a test"))
count(index='test', type='x',q="'a test'",default_operator="AND")
...返回一个匹配项。
count(index='test', type='x',q="'a te*'",default_operator="AND")
...返回不匹配(虽然我也希望得到一个匹配)。
count(index='test', type='x',q="'a te/*'",default_operator="AND")
...产生错误 (Error: 400 - all shards failed)。
count(index='test', type='x',q="'a te'//*",default_operator="AND")
...返回不匹配。
欢迎任何帮助!谢谢。
PS。如果使用 count 函数无法做到这一点,那么使用 Search 函数也可以解决我的问题(使用 body 参数)。
【问题讨论】:
-
您使用的是哪个版本的
elastic和 Elasticsearch? -
我用的是5.4.0版
-
好的,
elastic(R pkg)的哪个版本? -
也是最新的,0.7.8版
标签: r elasticsearch