如何在solr 3.6.2中禁用附件的索引

时间:2013-11-29 09:52:30

标签: solr

我正在使用solr 3.6.2。如何在solr 3.6.2中禁用附件的索引。我的schema.xml:

<fieldType name="text_general" class="solr.TextField" positionIncrementGap="100">
    <analyzer type="index">
    <tokenizer class="solr.WhitespaceTokenizerFactory"/>
        <filter class="solr.EdgeNGramFilterFactory" minGramSize="3" maxGramSize="50" side="back" />
        <filter class="solr.EdgeNGramFilterFactory" minGramSize="3" maxGramSize="50" side="front"/>
        <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="1" catenateNumbers="0" catenateAll="0" splitOnCaseChange="1" types="myTypes.txt"/>
        <filter class="solr.LowerCaseFilterFactory"/>
    </analyzer>
<analyzer type="query">
    <tokenizer class="solr.WhitespaceTokenizerFactory"/>
        <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" />
        <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
    <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" catenateWords="0" catenateNumbers="0" catenateAll="0" splitOnCaseChange="1" types="myTypes.txt"/>
    <filter class="solr.LowerCaseFilterFactory"/>
</analyzer>
</fieldType>

<copyField source="body" dest="an_text" maxChars="128000"/>
<field name="an_text"   type="text"   indexed="true" stored="false" />

<fieldType name="text" class="solr.TextField" positionIncrementGap="100">
  <analyzer>
        <tokenizer class="solr.StandardTokenizerFactory"/>
        <filter class="solr.EdgeNGramFilterFactory" minGramSize="3" maxGramSize="50" side="front"/>
        <filter class="solr.LowerCaseFilterFactory"/>
  </analyzer>
  <analyzer type="query">
        <tokenizer class="solr.StandardTokenizerFactory"/>
    <!--<tokenizer class="solr.WhitespaceTokenizerFactory"/>-->
        <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" />
        <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
    <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" catenateWords="0" catenateNumbers="0" catenateAll="0" splitOnCaseChange="1" types="myTypes.txt"/>
    <filter class="solr.LowerCaseFilterFactory"/>
</analyzer>
</fieldType>

我的文件myTypes.txt:

% => DIGIT
- => DIGIT

当我构建索引时,附件也会编入索引。我想禁用索引构建附件。

0 个答案:

没有答案