> 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">
<analyzer>
<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"/>
</analyzer>
</fieldType>
Also: "KeywordTokenizer does no actual tokenizing, so the entire input string
is preserved as a single token" [from example\solr\conf\schema.xml]