Wildcard queries are case sensitive, while other queries depend on the
analyzer used for the field searched.  The standard analyzer lowercases, so
lowercased terms are indexed.  Thus your "SPINAL CORD" query is lowercased
and matches the indexed terms "spinal" and "cord".  However, since prefixes
should not be stemmed they are not run through an analyzer and are hence
case sensitive.  Your index contains no terms starting with "SPI" or "COR",
since all terms were lowercased when indexed.

This question is frequent enough that we should probably fix it.  Perhaps a
method should be added Analyzer:
  public boolean isLowercased(String fieldName);
When this is true, the query parser could lowercase prefix and range query
terms.  Fellow Lucene developers, what do you think of that?

Doug

> -----Original Message-----
> From: Aruna Raghavan [mailto:[EMAIL PROTECTED]]
> Sent: Monday, January 21, 2002 2:05 PM
> To: Lucene Users List
> Subject: Case Sensitivity 
> 
> 
> Hi All,
> I have noticed that I can not search using capital letters 
> for some reason.
> If I try to do a search on "SPINAL CORD" and if I use a query 
> like SPI* AND
> COR*, I get no results back. If I use lowercase (spi* AND 
> cor*) however, I
> get the results back. I am using a standard analyzer. Does 
> anyone know why?
> Thanks!
> 
> --
> To unsubscribe, e-mail:   
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: 
> <mailto:[EMAIL PROTECTED]>
> 

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to