org.apache.lucene.analysis.miscellaneous

Class LimitTokenCountFilterFactory



  • public class LimitTokenCountFilterFactory
    extends TokenFilterFactory
    Factory for LimitTokenCountFilter.
     <fieldType name="text_lngthcnt" class="solr.TextField" positionIncrementGap="100">
       <analyzer>
         <tokenizer class="solr.WhitespaceTokenizerFactory"/>
         <filter class="solr.LimitTokenCountFilterFactory" maxTokenCount="10" consumeAllTokens="false" />
       </analyzer>
     </fieldType>

    The consumeAllTokens property is optional and defaults to false. See LimitTokenCountFilter for an explanation of its use.