Hi, Mattias. 

That's exactly what we did. One interesting note: the query and get methods 
seemed to work without lower casing the search term (maybe the analyzer is used 
to parse the query?), but for native lucene queries we needed to lowercase 
them.  All good now!  Thanks for the tips.

Rick 

On Oct 25, 2011, at 7:08 PM, "Mattias Persson" <[email protected]> 
wrote:

> Hi Rick,
> 
> yes you can do that, but not in a super easy way. What you'd have to do
> right now to get it working is to make sure you create an index with a
> special analyzer which converts everything to lower case (both additions and
> queries), effectively making it case insensitive. So create a class like
> this:
> 
>    public class LowerCaseAnalyzer extends Analyzer
>    {
>        @Override
>        public TokenStream tokenStream( String fieldName, Reader reader )
>        {
>            return new LowerCaseFilter( Version.LUCENE_31, new
> KeywordTokenizer( reader ) );
>        }
>    }
> 
> and make sure you create your index with a configuration map like:
> 
>    Index<Node> index = graphDb.index().forNodes(
>            "myCaseInsensitiveIndex", MapUtil.stringMap( "analyzer",
> LowerCaseAnalyzer.class.getName() ) );
> 
> then this will work:
> 
>    index.add( node, "name", "Rick Bullotta" );
>    index.query( "name:\"rick bullotta\"" ); // ==> returns that node.
> 
> 2011/10/25 Rick Bullotta <[email protected]>
> 
>> Anyone able to provide some insights on this?
>> 
>> Thanks.
>> ________________________________________
>> From: [email protected] [[email protected]] On
>> Behalf Of Rick Bullotta [[email protected]]
>> Sent: Monday, October 24, 2011 6:16 PM
>> To: Neo4j user discussions
>> Subject: [Neo4j] Default Analyzer in Index Framework
>> 
>> When not using fulltext indexing, what Lucene Analyzer class does Neo4J
>> use?  It seems that non-fulltext index searches are case sensitive - we'd
>> like to change that behavior.
>> 
>> Thanks for any help/guidance/examples!
>> 
>> Rick
>> 
>> _______________________________________________
>> Neo4j mailing list
>> [email protected]
>> https://lists.neo4j.org/mailman/listinfo/user
>> _______________________________________________
>> Neo4j mailing list
>> [email protected]
>> https://lists.neo4j.org/mailman/listinfo/user
>> 
> 
> 
> 
> -- 
> Mattias Persson, [[email protected]]
> Hacker, Neo Technology
> www.neotechnology.com
> _______________________________________________
> Neo4j mailing list
> [email protected]
> https://lists.neo4j.org/mailman/listinfo/user
_______________________________________________
Neo4j mailing list
[email protected]
https://lists.neo4j.org/mailman/listinfo/user

Reply via email to