【问题标题】:Solr Facet Query result cachingSolr Facet 查询结果缓存
【发布时间】:2014-05-12 12:40:15
【问题描述】:

我有一个使用 Nutch 和 Solr 运行的医学术语搜索引擎,它使用 PHP 前端。连同搜索结果,它将显示数千个预定义术语的标记计数,标记结果是通过将所有术语通过 solr facet 查询传递给 solr 来检索的。

如何在 solr 中添加所有这些术语,而无需每次都通过查询,然后获取然后获取搜索结果中每个术语的构面计数。下面给出了我用于检索方面计数的部分查询:

fl=content,url&facet=true&facet.field=host&facet.zeros=false&facet.query=content:Pfizer&facet.query=content:Teva&facet.query=content:Genentech&facet.query=content:Abbot&facet.query=content:Constipation&facet.query =content:Constipate&facet.query=content:Constipated&facet.query=content:Constipates&facet.query=content:Constipation&facet.query=content:Diarrhea&facet.query=content:Depression&facet.query=content:Depressions&facet.query=content:Depressed&facet.query=content :Sad&facet.query=content:Cramps&facet.query=content:Cough&facet.query=content:Xyrem&facet.query=content:Abilify&facet.query=content:Metformin&facet.query=content:Avastin'

提前致谢。

【问题讨论】:

    标签: php solr search-engine taxonomy faceted-search


    【解决方案1】:

    这里可以做的最多就是将您的查询减少到以下内容。

    ...
    facet.query = content: [OR Pfizer Teva Genentech Abbot ... Avastin]
    ...
    

    或者,您可以使用“facet.method=enum”,根据该字段,将返回所有值的方面。

    我在 Solr 中找不到其他方法,您可以使用键或标签将“查询变量”本身保存在缓存中。尽管如此,Solr 有名为“tag”、“ex”和“key”的 LocalParam,但它们不符合您的要求。

    参考资料:

    1. http://solr.pl/en/2010/12/06/faceting-eliminowanie-filtrow-i-jak-z-tego-skorzystac/
    2. http://wiki.apache.org/solr/SimpleFacetParameters
    3. http://wiki.apache.org/solr/SolrFacetingOverview

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-10-18
      • 1970-01-01
      • 2019-08-07
      • 1970-01-01
      • 2013-06-05
      • 2018-04-13
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多