1

我的 Solr 服务器似乎只使用 AND 而不是 OR,例如

/solr/select?q=(marsden AND emma)&qt=yodl_handler works, but 
/solr/select?q=(marsden OR mackey)&qt=yodl_handler doesn't.

对于每个单独的查询,它返回结果,例如

/solr/select?q=marsden&qt=yodl_handler returns 2 results
/solr/select?q=mackey&qt=yodl_handler returns 3 results

任何建议表示赞赏!

这是 yodl_handler 的定义:

<requestHandler name="yodl_handler" class="solr.DisMaxRequestHandler">
    <lst name="defaults">
      <str name="echoParams">explicit</str>
      <float name="tie">0.01</float>
      <str name="qf">
        dc.title^1 dc3.title^1 dc.type^1 vra2.logical.creator^1 vra2.image.agent.name^1 vra2.image.agent.role^1 vra2.image.agent.role^1 vra2.image.location.name^1 vra2.image.rights.rightsholder^1 vra2.image.source.refid^1 vra2.image.title^1 vra2.image.worktype^1 vra2.work.agent.attribution^1 vra2.work.agent.name^1 vra2.work.agent.role^1 vra2.work.culturalContext^1 vra2.work.description^1 vra2.work.location-type^1 vra2.logical.location.place^1 vra2.logical.location.name^1 vra2.work.location.refid^1 vra2.work.material^1 vra2.work.rights.rightsHolder^1 vra2.work.StylePeriod^1 vra2.work.subject.term.name^1 vra2.work.subject.term.place^1 vra2.work.subject.term.keyword^1 vra2.work.technique^1 vra2.work.title^1 vra2.work.worktype^1 iris2.instrument.instrumentType^1 iris2.instrument.primaryInstrumentType^1 iris2.instrument.secondaryInstrumentType^1 iris2.instrument.instrumentType.alltypes^1 iris2.instrument.author^1 iris2.references.allauthors^1 iris2.instrument.researchArea^1 iris2.instrument.typeOfFile^1 iris2.instrument.software^1 iris2.instrument.dataType^1 iris2.instrument.linguisticTarget^1 iris2.instrument.sourceLanguage^1 iris2.instrument.funder^1 iris2.instrument.licence^1 iris2.participants.participantType^1 iris2.participants.firstLanguage^1 iris2.participants.targetLanguage^1 iris2.participants.gender^1 iris2.participants.proficiencyLearner^1 iris2.participants.proficiencyStudentsTaught^1 iris2.participants.yearsOfTeachingExperience^1 iris2.participants.domainOfUse^1 iris2.references.publicationType^1 iris2.references.author^1 iris2.references.author.lastnames^1 iris2.references.booktitle^1 iris2.references.journal^1 iris2.references.publicationDate^1 iris2.references.publicationLatestDate^1 iris2.references.publisher^1 iris2.references.placeOfPublication^1 iris2.references.editor^1 iris2.references.conferenceName^1
      </str>
      <int name="ps">100</int>
      <str name="q.alt">*:*</str>
      <str name="hl.fl">text features name</str>
      <str name="f.name.hl.fragsize">0</str>
      <str name="f.name.hl.alternateField">name</str>
      <str name="f.text.hl.fragmenter">regex</str>
    </lst>
</requestHandler>
4

1 回答 1

1

简单的答案是,Solr DisMax 查询解析器不支持查询中的布尔逻辑。它与涉及“AND”的查询一起使用的外观可能是您的字段索引方式(停用词?)或出现在基础数据中的副作用。

如果您发送 debugQuery 参数,您可以更好地了解幕后发生的事情,例如:

/solr/select?q=(marsden AND emma)&qt=yodl_handler&debugQuery=true

Solr wiki 上有更多关于 Dismax 解析器的文档:

Dismax 查询解析器支持 Lucene QueryParser 语法的一个极其简化的子集。引号可用于对短语进行分组,+/- 可用于表示强制和可选子句……但所有其他 Lucene 查询解析器特殊字符都被转义以简化用户体验。(参见DisMaxQParserPlugin

好消息是,如果您使用的是现代版本的 Solr (3.1+),您可以访问新的ExtendedDisMax解析器,它支持布尔查询。`

于 2012-09-19T16:17:08.550 回答