是否有任何工具或简便技术将复杂的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/

10-17 03:13