【发布时间】:2017-06-23 06:05:02
【问题描述】:
我希望采用“常规”搜索查询,例如“(是与否)或(可能)”并将其转换为弹性搜索格式。 AFAIK ES 基于 Lucene,它确实接受类似的查询,那么为什么没有简单的方法来类似地查询 ES?我没有找到执行此操作的 php 库,这让我想知道我是否遗漏了一些东西。这两种格式不容易转换吗?
【问题讨论】:
标签: php elasticsearch lucene
我希望采用“常规”搜索查询,例如“(是与否)或(可能)”并将其转换为弹性搜索格式。 AFAIK ES 基于 Lucene,它确实接受类似的查询,那么为什么没有简单的方法来类似地查询 ES?我没有找到执行此操作的 php 库,这让我想知道我是否遗漏了一些东西。这两种格式不容易转换吗?
【问题讨论】:
标签: php elasticsearch lucene
绝对可以在 query_string query 中使用逐字 Lucene 查询
GET /_search
{
"query": {
"query_string" : {
"default_field" : "content",
"query" : "this AND that OR thus" <--- put your Lucene query here
}
}
}
【讨论】:
"query"上方添加"_source": ["field1", "field2", ...]
"\"this that\" AND thus"