如何在Solr中搜索多个面

如何在Solr中搜索多个面

本文介绍了如何在Solr中搜索多个面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在solr中搜索构面,如下所示:

  • fq = country:usa
  • fq = country:canada
  • fq = topic:工业
  • fq = topic:political
  • I need to search for facets in solr as below:

  • fq=country:usa
  • fq=country:canada
  • fq=topic:industrial
  • fq=topic:political
  • 现在我需要搜索具有以上方面(逻辑与)和(逻辑与)的文章.
    假设我有以下文章

    now i need to search for the articles that have the above facets (logical And) and (logical Or).
    suppose that i have the following articles

    1. country =美国法国//主题:工业科学
    2. country =美国加拿大//主题:工业
    3. country =美国加拿大//主题:工业政治

    现在,我已经尝试过

    
    http://127.0.0.1:8888/solr/Collection1/select?q=*:*&start=0&rows=10&facet=true&fq=country:USA&fq=country:canada&fq=topic:political&fq=topic:industrial
    

    但是这没有返回任何东西:(您能指导我如何通过与"或与"之间的操作来搜索这些面孔吗?谢谢您的帮助

    but this didnt return anything :(could you please guide me to how to search for those faces by ANDing and ORing between them
    Thanks for your help

    推荐答案

    您可以使用布尔运算符来过滤结果.

    You can use boolean operators to filter the results.

    OR-fq=country:(USA OR canada)&fq=topic:(political OR industrial)

    AND-fq=country:(USA AND canada)&fq=topic:(political AND industrial)

    这篇关于如何在Solr中搜索多个面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

    09-06 03:24