简体   繁体   English

Solr的“更像这样”是否支持方面查询?

[英]Does Solr's “More like this” support facet queries?

I have been able to facet and highlight with the Dismax handler. 我已经能够使用Dismax处理程序来介绍和突出显示。

I tried to do faceting for More Like This results , such as this query: "fetch documents similar to '11qualcomm.doc' whose 'doc_keywords' has 'Communication' as mandatory. 我尝试对“更多类似此”结果进行分 ,例如以下查询:“获取与'11qualcomm.doc'类似的文档,其'doc_keywords'必须具有'Communication'。

select?
facet=on&facet.field=doc_keywords&facet.mincount=1
&fl=id,score
&fq=doc_keywords:%22Communication%22
&indent=true
&mlt=true&mlt.count=20
&mlt.fl=doc_keywords_searchable,doc_author_searchable,doc_abstract,text&mlt.mindf=1&mlt.mintf=1
&mlt.qf=doc_keywords_searchable%5E15+doc_author_searchable%5E15+doc_abstract%5E10+text
&q=id:%2211qualcomm.doc%22
&rows=1&wt=python

But the results are: 但是结果是:

'facet_counts':{
    'facet_queries':{},
    'facet_fields':{
      'doc_keywords':[
        'Communication',1,
        'Corporation',1]},
    'facet_dates':{},
    'facet_ranges':{}}

Which implies that the faceting only worked for q=id:"11qualcomm.doc" and not for the MLT result set. 这意味着面仅适用于q = id:“ 11qualcomm.doc” ,不适用于MLT结果集。

Does faceting work for the MLT result set? 构面适用于MLT结果集吗? If yes, what am I doing wrong? 如果是,我在做什么错?

Found the answer myself. 自己找到答案。 I am supposed to use the More Like This handler, instead of using the MLT of the search handler. 我应该使用More Like This处理程序,而不是使用搜索处理程序的MLT。 The MLT handler "supports faceting, paging, and filtering using CommonQueryParameters" (from wiki). MLT处理程序“支持使用CommonQueryParameters进行构面,分页和筛选”(来自Wiki)。

Filter queries were recently added as an support for the Solr More Like this feature. 最近添加了过滤器查询,以支持Solr More Like this功能。
https://issues.apache.org/jira/browse/SOLR-2351 https://issues.apache.org/jira/browse/SOLR-2351

The fix version marked however is 3.5 and 4.0, so it may not work for you. 但是,标记为该修补程序的版本是3.5和4.0,因此它可能不适用于您。
Can check for the patch or upgrade. 可以检查补丁或升级。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM