You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-dev@lucene.apache.org by Peter S <pe...@hotmail.com> on 2010/01/20 18:26:08 UTC

Case-insensitive searches and facet case

Hi,
 
Regarding case-insensitive searching:
 
In order to support 'case-insensivity' (lower-casing, really), I've set my index-time and query-time fieldType analyzer to use a LowerCaseFilterFactory filter. This works, but then all my facets get returned in lower-case (e.g. 'object:MyObject (3)' becomes 'object:myobject (3)').
 
Is there a way to maintain case-impartiality whilst allowing facets to be returned 'case-preserved'?
 
Thanks,
Peter
 
 		 	   		  
_________________________________________________________________
Got a cool Hotmail story? Tell us now
http://clk.atdmt.com/UKM/go/195013117/direct/01/

Re: Case-insensitive searches and facet case

Posted by Ted Dunning <te...@gmail.com>.
To amplify this correct answer, use one field for searching (querying).
This would be lower cased.  Then use a second field for faceting (case
preserved).  The only gotcha here is that your original data may have
inconsistent casing.  My usual answer for that is to either impose a
conventional case pattern (which takes you back to one field if you like) or
to do a spelling corrector analysis to find the most common case pattern for
each unique lower cased string.  Then during indexing, I impose that pattern
on the facet field.

On Wed, Jan 20, 2010 at 9:46 AM, Erik Hatcher <er...@gmail.com>wrote:

> Is there a way to maintain case-impartiality whilst allowing facets to be
>> returned 'case-preserved'?
>>
>
> Yes, use different fields.  Generally facet fields are "string" which will
> maintain exact case.  You can leverage the copyField capabilities in
> schema.xml to clone a field and analyze it differently.




-- 
Ted Dunning, CTO
DeepDyve

RE: Case-insensitive searches and facet case

Posted by Peter S <pe...@hotmail.com>.
Hi Erik,

 

Thanks for your reply,

 

As soon as you mentioned it, I realized I have used this technique in the past with a couple of fields...so thanks for jogging my failing memory!

 

Thanks,

Peter

 

 


 
> From: erik.hatcher@gmail.com
> To: solr-dev@lucene.apache.org
> Subject: Re: Case-insensitive searches and facet case
> Date: Wed, 20 Jan 2010 12:46:44 -0500
> 
> 
> On Jan 20, 2010, at 12:26 PM, Peter S wrote:
> 
> >
> > Hi,
> >
> > Regarding case-insensitive searching:
> >
> > In order to support 'case-insensivity' (lower-casing, really), I've 
> > set my index-time and query-time fieldType analyzer to use a 
> > LowerCaseFilterFactory filter. This works, but then all my facets 
> > get returned in lower-case (e.g. 'object:MyObject (3)' becomes 
> > 'object:myobject (3)').
> >
> > Is there a way to maintain case-impartiality whilst allowing facets 
> > to be returned 'case-preserved'?
> 
> Yes, use different fields. Generally facet fields are "string" which 
> will maintain exact case. You can leverage the copyField capabilities 
> in schema.xml to clone a field and analyze it differently.
> 
> Erik
> 
 		 	   		  
_________________________________________________________________
Got a cool Hotmail story? Tell us now
http://clk.atdmt.com/UKM/go/195013117/direct/01/

Re: Case-insensitive searches and facet case

Posted by Erik Hatcher <er...@gmail.com>.
On Jan 20, 2010, at 12:26 PM, Peter S wrote:

>
> Hi,
>
> Regarding case-insensitive searching:
>
> In order to support 'case-insensivity' (lower-casing, really), I've  
> set my index-time and query-time fieldType analyzer to use a  
> LowerCaseFilterFactory filter. This works, but then all my facets  
> get returned in lower-case (e.g. 'object:MyObject (3)' becomes  
> 'object:myobject (3)').
>
> Is there a way to maintain case-impartiality whilst allowing facets  
> to be returned 'case-preserved'?

Yes, use different fields.  Generally facet fields are "string" which  
will maintain exact case.  You can leverage the copyField capabilities  
in schema.xml to clone a field and analyze it differently.

	Erik