我有一个要求,我们需要获取像
这样的值CustomerID 不在 SOLR 索引中(编入索引的 ID 列表)。
谁能建议我们如何使用 solr 查询来实现这一点?
最佳答案
使用过滤器查询fq=-id:("id1", id:"id2")
示例
http://localhost:8983/solr/collection/select?indent=on&q=querystring&wt=json&fq=-id:("id1", id:"id2")
这里它会丢弃过滤器查询(fq)参数中提到的 ID 列表的文档
关于SOLR 查询类似于 NOT IN (LIST),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40591172/