jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Haycock <Robert.Hayc...@artificial-solutions.com>
Subject RE: How to make indexing case insensitive
Date Thu, 06 Dec 2012 15:43:47 GMT
That explains it. I thought the analyzer was also used for indexing, from my Lucene days.


-----Original Message-----
From: Marcel Reutegger [mailto:mreutegg@adobe.com] 
Sent: 06 December 2012 15:06
To: users@jackrabbit.apache.org
Subject: RE: How to make indexing case insensitive


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:


> -----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
> Thanks,
> Rob.

View raw message