gpt4 book ai didi

elasticsearch - ElasticSearch bool 查询到Solrj查询

转载 作者:行者123 更新时间:2023-12-02 23:18:02 25 4
gpt4 key购买 nike

是否有任何工具或简便技术将复杂的ES bool(boolean) 查询迁移到Solr / Solrj查询。
我知道must => AND should => OR需要更改。
在此处查询示例-

{
"bool": {
"must": [
{
"term": {
"locale": {
"value": "XXX",
"boost": 1
}
}
},
{
"terms": {
"contentType": [
"YYY",
"ZZZ"
],
"boost": 1
}
},
{
"terms": {
"docId": [
"ABC",
"JKL"
],
"boost": 1
}
},
{
"term": {
"unPublished": {
"value": false,
"boost": 1
}
}
}
],
"disable_coord": false,
"adjust_pure_negative": true,
"boost": 1
}
}

最佳答案

您可以使用JSON Query DSL and compound queries

{
"query": {
"bool": {
"must": [
"title:solr",
"content:(lucene solr)"
],
"must_not": "{!frange u:3.0}ranking"
}
}
}

关于elasticsearch - ElasticSearch bool 查询到Solrj查询,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52589386/

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