gpt4 book ai didi

php - 将 bool 搜索查询转换为ElasticSearch格式

转载 作者:行者123 更新时间:2023-12-03 01:48:40 25 4
gpt4 key购买 nike

我正在寻找一个“常规”搜索查询,例如“(是和否)或(也许)”,并将其转换为 Elasticsearch 格式。 AFAIK ES是基于Lucene的,Lucene确实接受类似的查询,那么为什么没有一种简单的方法可以类似地查询ES?我没有找到能做到这一点的php lib,这使我想知道我是否缺少某些东西。两种格式难于转换吗?

最佳答案

绝对有可能在 query_string query中使用逐字Lucene查询

GET /_search
{
"query": {
"query_string" : {
"default_field" : "content",
"query" : "this AND that OR thus" <--- put your Lucene query here
}
}
}

关于php - 将 bool 搜索查询转换为ElasticSearch格式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42065391/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com