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 manju16832003 <ma...@gmail.com> on 2013/12/05 11:09:08 UTC
Re: Difference between textfield and strfield
Hi,
If we can not analyse string field, is there any other way to apply case
insensitiveness.
Ex: I have a field called *make* its values are Toyota, Honda, Chery etc. In
Solr make data type is string and values are stored as they appear (Toyota,
Honda, Chery).
However, when user try to search for toyota (instead Toyota), Solr wont
fetch any result set as it does not match the exact word Toyota.
I thought of applying LowerCaseFilterFactory at query level, but as its
string field, I won't be able to do that.
Is there any way, as I would like to search the user with case insensitive.?
--
View this message in context: http://lucene.472066.n3.nabble.com/Difference-between-textfield-and-strfield-tp3986916p4105095.html
Sent from the Solr - User mailing list archive at Nabble.com.
Re: Difference between textfield and strfield
Posted by manju16832003 <ma...@gmail.com>.
Hey Iori,
Apologize for misunderstanding :-).
Yes agree with you, faceting will be OK with TextField type however I'm
concern about performance impact while running the facets if we have
millions of documents.
I wish in future we could apply tokensizers and filters to String fields.
:-).Thanks for your inputs.
--
View this message in context: http://lucene.472066.n3.nabble.com/Difference-between-textfield-and-strfield-tp3986916p4105841.html
Sent from the Solr - User mailing list archive at Nabble.com.
Re: Difference between textfield and strfield
Posted by Ahmet Arslan <io...@yahoo.com>.
Hi Manju,
Ahmet is me :) Faceting will be OK with lowercase field type. Even if it is solr.TextField. KeywordTokenizer keeps its input as a single token. Similar behavior as string field. With solr.TextField + KeywordTokenizer you can add further token filters. For example lowercase filter. With string type you cannot add any token filters.
As Erick suggested, you can play with field types at Admin analysis page. It allows you to enter sample text and displays generated tokens visually.
On Sunday, December 8, 2013 2:00 PM, manju16832003 <ma...@gmail.com> wrote:
I don't understand. Use the field type *Ahmet* recommended. Who is Ahmet?
--
View this message in context: http://lucene.472066.n3.nabble.com/Difference-between-textfield-and-strfield-tp3986916p4105570.html
Sent from the Solr - User mailing list archive at Nabble.com.
Re: Difference between textfield and strfield
Posted by manju16832003 <ma...@gmail.com>.
I don't understand. Use the field type *Ahmet* recommended. Who is Ahmet?
--
View this message in context: http://lucene.472066.n3.nabble.com/Difference-between-textfield-and-strfield-tp3986916p4105570.html
Sent from the Solr - User mailing list archive at Nabble.com.
Re: Difference between textfield and strfield
Posted by Erick Erickson <er...@gmail.com>.
Use the field type Ahmet recommended. It'll look almost exactly like String
with the exception it'll be case insensitive. Take a look at the
admin/analysis page with this field type and you'll understand why we're
recommending this.
Best,
Erick
On Thu, Dec 5, 2013 at 8:33 PM, manju16832003 <ma...@gmail.com>wrote:
> Hi Iori,
>
> Thank you replying, really appreciate that.
>
> My concern not to use *TextField* and I want to make use of *string* field.
>
> Reason is that I have 7 fields that I want to apply case-insensitiveness
> and
> all these fields are *facetable* fields. It would not be feasible if I
> change data type from String to TextField just to apply
> case-insensitiveness. However Solr document suggests that if we were to
> make
> fields facetable, its better to use String.
>
> Is there any way of achieving this using String itself?.
>
> Thank you,
> Manju
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Difference-between-textfield-and-strfield-tp3986916p4105238.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>
Re: Difference between textfield and strfield
Posted by manju16832003 <ma...@gmail.com>.
Hi Iori,
Thank you replying, really appreciate that.
My concern not to use *TextField* and I want to make use of *string* field.
Reason is that I have 7 fields that I want to apply case-insensitiveness and
all these fields are *facetable* fields. It would not be feasible if I
change data type from String to TextField just to apply
case-insensitiveness. However Solr document suggests that if we were to make
fields facetable, its better to use String.
Is there any way of achieving this using String itself?.
Thank you,
Manju
--
View this message in context: http://lucene.472066.n3.nabble.com/Difference-between-textfield-and-strfield-tp3986916p4105238.html
Sent from the Solr - User mailing list archive at Nabble.com.
Re: Difference between textfield and strfield
Posted by Ahmet Arslan <io...@yahoo.com>.
Hi Manju,
You can use the following type ( taken from example schema.xml) . You may add TrimFilterFactory too.
<!-- lowercases the entire field value, keeping it as a single token. -->
<fieldType name="lowercase" class="solr.TextField" positionIncrementGap="100">
<analyzer>
<tokenizer class="solr.KeywordTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory" />
</analyzer>
</fieldType>
On Thursday, December 5, 2013 12:09 PM, manju16832003 <ma...@gmail.com> wrote:
Hi,
If we can not analyse string field, is there any other way to apply case
insensitiveness.
Ex: I have a field called *make* its values are Toyota, Honda, Chery etc. In
Solr make data type is string and values are stored as they appear (Toyota,
Honda, Chery).
However, when user try to search for toyota (instead Toyota), Solr wont
fetch any result set as it does not match the exact word Toyota.
I thought of applying LowerCaseFilterFactory at query level, but as its
string field, I won't be able to do that.
Is there any way, as I would like to search the user with case insensitive.?
--
View this message in context: http://lucene.472066.n3.nabble.com/Difference-between-textfield-and-strfield-tp3986916p4105095.html
Sent from the Solr - User mailing list archive at Nabble.com.