elasticsearch - ElasticSearch 布尔查询到 Solrj 查询
问题描述
是否有任何工具或简单的技术可以将复杂的 ES 布尔查询迁移到 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 和复合查询。
{
"query": {
"bool": {
"must": [
"title:solr",
"content:(lucene solr)"
],
"must_not": "{!frange u:3.0}ranking"
}
}
}
推荐阅读
- python - Keras 模型仅在尝试逼近数学函数时生成一个平面
- javascript - 按下回车键时如何将焦点移到下一个字段?我尝试了很多方法,但没有任何效果
- angular - RXJS 在 forkJoin 可观察数组中捕获错误
- r - 如何根据矩阵位置计算总分?
- solr - 用于 Html 的 Solr 数据导入处理程序
- excel - 自动筛选与 ShowAllData
- javascript - 量角器黄瓜配置文件为我的场景抛出未定义的警告,即使这些场景存在
- python - 将 PySpark 中的两个 DataFrame 组合成矩阵
- apache-spark - 无法使用 Nifi 和 Schema Registry 使用 Kafka Avro 记录
- python - 如何根据python中的正确答案按递增顺序显示学生