简体   繁体   English

Solr:一词查询与三词索引值不匹配

[英]Solr: One word query does not match three word indexed value

One of my documents has a title attribute with the value Poésie pour pouvoir . 我的一份文档的title属性值为Poésie pour pouvoir When I query q=title:poesie , no results are found. 当我查询q=title:poesie ,未找到结果。 q=title:poesie pour finds the document, though. q=title:poesie pour找到文档。

title is of type text . titletext类型。 Excerpt from my schema.xml: 摘录自我的schema.xml:

<fieldType name="text" class="solr.TextField" positionIncrementGap="100">
    <analyzer type="index">
        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
        <filter class="solr.ASCIIFoldingFilterFactory" />
        <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt"/>
        <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1"
                catenateWords="1" catenateNumbers="1" catenateAll="0" splitOnCaseChange="1"/>
        <filter class="solr.LowerCaseFilterFactory"/>
        <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
        <filter class="solr.SnowballPorterFilterFactory" language="German2"/>
        <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
    </analyzer>
    <analyzer type="query">
        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
        <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
        <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt"/>
        <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1"
                catenateWords="0" catenateNumbers="0" catenateAll="0" splitOnCaseChange="1"/>
        <filter class="solr.LowerCaseFilterFactory"/>
        <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
        <filter class="solr.SnowballPorterFilterFactory" language="German2"/>
        <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
    </analyzer>
</fieldType>

The second query isn't searching the title field only - it's also searching the default search field. 第二个查询不仅在搜索标题字段,还在搜索默认搜索字段。 The query is parsed as "title:poesie default_field:pour". 该查询被解析为“ title:poesie default_field:pour”。 The second part is what's generating the hit. 第二部分是产生点击量的原因。

You can use the debugQuery parameter to see how your query is being parsed. 您可以使用debugQuery参数来查看查询的解析方式。 Use the analysis page under the Solr admin page to see why the title value doesn't match (input "Poésie pour pouvoir" under "indexed" value and "poesie" under query value). 使用Solr管理员页面下的分析页面查看标题值为何不匹配(在“索引”值下输入“Poésiepour pouvoir”,在查询值下输入“ poesie”)。

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

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