Home | About | Sematext search-lucene.com search-hadoop.com
 Search Lucene and all its subprojects:

Switch to Threaded View
Solr, mail # user - Is it compulsory to define a tokenizer when defining field types in solr


Copy link to this message
-
Re: Is it compulsory to define a tokenizer when defining field types in solr
Erick Erickson 2012-06-29, 13:08
Yes, it's mandatory to define at least one tokenizer (and only one
tokenizer). If
you need the whole input treated as one token, you can use
KeywordTokenizerFactory.

Best
Erick

On Thu, Jun 28, 2012 at 11:10 AM, Kissue Kissue <[EMAIL PROTECTED]> wrote:
> Hi,
>
> When defining a fieldtype is it compulsory to include a tokenizer in its
> definition?
>
> I have a field defined as follows without tokenizer:
>
> <fieldType name="lowercase_pattern" class="solr.TextField"
> positionIncrementGap="100">
>      <analyzer type="index">
>        <filter class="solr.LowerCaseFilterFactory" />
>      </analyzer>
>      <analyzer type="query">
>        <filter class="solr.LowerCaseFilterFactory" />
>      </analyzer>
>    </fieldType>
>
> Using this field when i try to start up Solr it says the field is not
> recognised. But when i change it to the following with tokenizer included
> it works:
>
> <fieldType name="lowercase_pattern" class="solr.TextField"
> positionIncrementGap="100">
>      <analyzer type="index">
>        <tokenizer class="solr.KeywordTokenizerFactory"/>
>        <filter class="solr.LowerCaseFilterFactory" />
>      </analyzer>
>      <analyzer type="query">
>        <tokenizer class="solr.KeywordTokenizerFactory"/>
>        <filter class="solr.LowerCaseFilterFactory" />
>      </analyzer>
>    </fieldType>
>
> Thanks.