我在SOLR工作,我想在solr中使用联合和减号的组合。我已经制定了oracle查询。
select * from TESTTABLE where (FT = 'PE' and emis between 10 and 20) or (FT = 'DI' and emis between 10 and 15)
union (
select * from TESTTABLE where (FT <> 'PE' or emis not between 10 and 20) and (FT <> 'DI' or emis not between 10 and 15)
minus
select * from TESTTABLE where (FT = 'PE' and emis not between 10 and 20) or (FT = 'DI' and emis not between 10 and 15)
);我想制定一个等价的SOLR。请让我把oracle查询转换成SOLR。
发布于 2017-06-14 21:27:26
您应该能够在Solr中构建它,只需考虑:
发布于 2017-06-17 01:34:27
因此,对于您的示例:获取年龄范围为10到25的漫画和电影摄影中的书籍,并假设有三个字段bookName,bookType和Age.我将执行以下操作:
q=bookType:Comics bookType:Filmography&fq=age:10 TO 25
主查询中的两个bookType子句之间没有空格表示OR。例如,带一部漫画或一部电影。并且过滤查询中的年龄范围,即fq,过滤出年龄不在10到25之间的结果。
https://stackoverflow.com/questions/44539461
复制相似问题