Solr OR 查询不同方面的组合
我有一个示例 Solr 架构,如下所示,
isPublic = boolean
source = facebook| twitter | wordpress
我想编写一个查询,该查询返回与 isPublic = true 或 isPublic is false 且 source= facebook 匹配的索引中的所有文档。像这样的事情
solrUrl/?q=blah&fq=(isPublic:true OR (isPublic:false AND source:facebook))
这样的事情可能吗?或者我应该用每个条件搜索索引两次,然后合并+消除重复的结果?
I have a sample Solr schema as follows
isPublic = boolean
source = facebook| twitter | wordpress
I want to write a query which returns all documents from the index which matches either the isPublic = true or isPublic is false and source= facebook. Something like this
solrUrl/?q=blah&fq=(isPublic:true OR (isPublic:false AND source:facebook))
Is such a thing possible or should I search the index two times with each of these conditions and then combine + de-duplicate the results?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当然,您可以运行这样的过滤器查询,但我认为特定查询不会为您提供您正在寻找的结果,请参阅 这个问题关于它。逻辑上等效的查询将是:
isPublic:true OR source:facebook
Sure you can run such a filter query, but I think that particular query will not get you the results you're looking for, see this question about it. A logically equivalent query would be:
isPublic:true OR source:facebook