lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ahmet Arslan <>
Subject Re: require synonym filter on string field
Date Thu, 29 Apr 2010 10:56:11 GMT
> I am wondering that KeywordTokenizerFactory will work or
> not in textfield. Actually as I understood about the
> KeywordTokenizerFactory that : KeywordTokenizerFactory is
> tokenize the keyword.
>  for example : 'solr user' will tokenize to 'solr' and
> 'user' because solr and user are keyword.. My requirement is
> to index as 'solr user'

you can use something like:

<fieldType name="mystring" class="solr.TextField" positionIncrementGap="100">
        <tokenizer class="solr.KeywordTokenizerFactory"/>        
        <filter class="solr.LowerCaseFilterFactory" />       
        <filter class="solr.TrimFilterFactory" />  
        <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true"
expand="true" tokenizerFactory="KeywordTokenizerFactory"/>     

Also: "KeywordTokenizer does no actual tokenizing, so the entire input string is preserved
as a single token" [from example\solr\conf\schema.xml] 


View raw message