You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Bing Hua <bh...@cornell.edu> on 2013/02/14 18:11:39 UTC
How to define a lowercase fieldtype without tokenizer
Hi,
I don't want the field to be tokenized because Solr doesn't support sorting
on a tokenized field. In order to do case insensitive sorting I need to copy
a field to a lowercase but not tokenized field. How to define this?
I did below but it says I need to specify a tokenizer or a class for
analyzer.
<fieldType name="text_lowercase" class="solr.TextField"
positionIncrementGap="100">
<analyzer type="index">
<filter class="solr.LowerCaseFilterFactory" />
</analyzer>
<analyzer type="query">
<filter class="solr.LowerCaseFilterFactory" />
</analyzer>
</fieldType>
Thanks!
--
View this message in context: http://lucene.472066.n3.nabble.com/How-to-define-a-lowercase-fieldtype-without-tokenizer-tp4040500.html
Sent from the Solr - User mailing list archive at Nabble.com.
Re: How to define a lowercase fieldtype without tokenizer
Posted by Bing Hua <bh...@cornell.edu>.
Works perfectly. Thank you. I didn't know this tokenizer does nothing before
:)
--
View this message in context: http://lucene.472066.n3.nabble.com/How-to-define-a-lowercase-fieldtype-without-tokenizer-tp4040500p4040507.html
Sent from the Solr - User mailing list archive at Nabble.com.
Re: How to define a lowercase fieldtype without tokenizer
Posted by Upayavira <uv...@odoko.co.uk>.
You can use a KeywordTokenizerFactory, which will tokenise into a single
term, and then do your lowercasing. Does that get you what you want?
Upayavira
On Thu, Feb 14, 2013, at 05:11 PM, Bing Hua wrote:
> Hi,
>
> I don't want the field to be tokenized because Solr doesn't support
> sorting
> on a tokenized field. In order to do case insensitive sorting I need to
> copy
> a field to a lowercase but not tokenized field. How to define this?
>
> I did below but it says I need to specify a tokenizer or a class for
> analyzer.
>
> <fieldType name="text_lowercase" class="solr.TextField"
> positionIncrementGap="100">
> <analyzer type="index">
> <filter class="solr.LowerCaseFilterFactory" />
> </analyzer>
> <analyzer type="query">
> <filter class="solr.LowerCaseFilterFactory" />
> </analyzer>
> </fieldType>
>
> Thanks!
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/How-to-define-a-lowercase-fieldtype-without-tokenizer-tp4040500.html
> Sent from the Solr - User mailing list archive at Nabble.com.