1

我有一个包含我想要的所有可搜索文本的字段,其中包含记录的关键字,如下所示:

    <field name="boardtext" type="text" indexed="true" stored="false" required="false" omitTermFreqAndPositions="true" />
    <copyField source="board_name"         dest="boardtext"/>
    <copyField source="offers_titles"      dest="boardtext"/>
    <copyField source="high_category_name" dest="boardtext"/>

但是每当我尝试通过该字段获取类似记录(MLT)时,返回的结果为零。我错过了什么吗?Solr 在寻找什么?

更新:

文本类型分析器:

        <!-- in this example, we will only use synonyms at query time -->
            <filter class="solr.SynonymFilterFactory" synonyms="synonyms_test.txt" ignoreCase="true" expand="false"/>
        <filter class="solr.SynonymFilterFactory" synonyms="synonyms_list.txt" ignoreCase="true" expand="false"/>
        <filter class="solr.SynonymFilterFactory" synonyms="synonyms_auto.txt" ignoreCase="true" expand="false"/>

        <!-- Case insensitive stop word removal.
          add enablePositionIncrements=true in both the index and query
          analyzers to leave a 'gap' for more accurate phrase queries.
        -->

        <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="0" catenateNumbers="0" catenateAll="0" splitOnCaseChange="0" protected="protwords.txt" />

            <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="1" catenateNumbers="1" catenateAll="0" splitOnCaseChange="1" protected="protwords.txt" />

            <!-- Common Grams filter 
            <filter class="solr.CommonGramsFilterFactory" words="commongrams.txt" ignoreCase="true"/>-->

        <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" enablePositionIncrements="true" />
            <filter class="solr.PatternReplaceFilterFactory" pattern="(\bcom\b)" replacement="\.$1" replace="all"/>

            <!-- Common Grams filter 
            <filter class="solr.CommonGramsFilterFactory" words="commongrams.txt" ignoreCase="true"/>-->

        <filter class="solr.LowerCaseFilterFactory"/>
        <filter class="solr.SnowballPorterFilterFactory" language="English" protected="protwords.txt"/>
            <filter class="solr.ASCIIFoldingFilterFactory"/>
      </analyzer>
      <analyzer type="query">
        <charFilter class="solr.MappingCharFilterFactory" mapping="mapping-ISOLatin1Accent.txt"/>
            <charFilter class="solr.MappingCharFilterFactory" mapping="mapping-special-chars.txt"/>
        <tokenizer class="solr.WhitespaceTokenizerFactory"/>

            <filter class="solr.SynonymFilterFactory" synonyms="synonyms_test.txt" ignoreCase="true" expand="true"/>
        <filter class="solr.SynonymFilterFactory" synonyms="synonyms_list.txt" ignoreCase="true" expand="true"/>
        <filter class="solr.SynonymFilterFactory" synonyms="synonyms_auto.txt" ignoreCase="true" expand="true"/>
        <!-- <filter class="solr.SynonymFilterFactory" synonyms="synonyms_wn.txt" ignoreCase="true" expand="false"/> -->

        <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="0" catenateNumbers="0" catenateAll="0" splitOnCaseChange="0" protected="protwords.txt" />

            <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="1" catenateNumbers="1" catenateAll="0" splitOnCaseChange="1" protected="protwords.txt" />

            <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" enablePositionIncrements="true" />
            <filter class="solr.PatternReplaceFilterFactory" pattern="(\bcom\b)" replacement="\.$1" replace="all"/>

            <!-- Common Grams filter 
            <filter class="solr.CommonGramsQueryFilterFactory" words="commongrams.txt" ignoreCase="true"/>-->

        <filter class="solr.LowerCaseFilterFactory"/>
        <filter class="solr.SnowballPorterFilterFactory" language="English" protected="protwords.txt"/>
            <filter class="solr.ASCIIFoldingFilterFactory"/>
      </analyzer>
    </fieldType>
4

0 回答 0