jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marcel Reutegger <mreut...@adobe.com>
Subject RE: How to make indexing case insensitive
Date Thu, 06 Dec 2012 15:05:41 GMT
Hi,

the analyzer is only used for fulltext query statements within a
CONTAINS() in SQL or jcr:contains() in XPath.

in your case you should rather use the built-in upper and lower case
functions available in Jackrabbit. See the corresponding JIRA issue
for a number of example queries:
https://issues.apache.org/jira/browse/JCR-638

Regards
 Marcel

> -----Original Message-----
> From: Robert Haycock [mailto:Robert.Haycock@artificial-solutions.com]
> Sent: Donnerstag, 6. Dezember 2012 14:40
> To: users@jackrabbit.apache.org
> Subject: How to make indexing case insensitive
> 
> Hi,
> 
> We have created our custom analyser and set the analyzer param in the
> workspace.xml...
> public class LowerCaseAnalyzer extends Analyzer {
> 
>     @Override
>     public TokenStream tokenStream(String fieldName, Reader reader) {
>         TokenStream stream = new LetterTokenizer(reader);
>         stream = new LowerCaseFilter(stream);
>         return stream;
>     }
> }
> And when I debug I can see it is being hit and tokens being converted to
> lowercase.
> On a node I have a property called "name" with value "FLOW". Problem is,
> when I do a JCR2 SQL search the sql "WHERE name = 'FLOW'" returns the
> node but "WHERE name = 'flow'" doesn't. This is not what I expected.
> My assumption was that the LowerCaseFilter would convert all text to lower
> case before being indexed.
> Is my assumption wrong? How should I tell Jackrabbit to index everything as
> lower case so when I search I can convert all my search terms to lower case?
> 
> Thanks,
> 
> Rob.

Mime
View raw message