ignore case search Neo4j

40 views
Skip to first unread message

Navrattan Yadav

unread,
Jan 30, 2014, 8:17:53 AM1/30/14
to ne...@googlegroups.com
hi. i am using Neo4j 2.0. I want to search by a properties value with ignore case and also with like operator.

eg. Node has properties >  Name : John Michle

then want to search by : john, John,john Michle etc.

i try  : 

START n = node:Name("Name=*john*") 
return n;

but not get result.

Michael Hunger

unread,
Jan 30, 2014, 8:26:17 AM1/30/14
to ne...@googlegroups.com
if you have indexed the property with a legacy lucene index (fulltext index for ignoring case) you can do:

START n = node:Name("Name:john") 
return n;

for multi words I think you have do it like this


START n = node:Name("Name:john michle") 
return n;


--
You received this message because you are subscribed to the Google Groups "Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email to neo4j+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Tom Zeppenfeldt

unread,
Jan 30, 2014, 8:30:14 AM1/30/14
to ne...@googlegroups.com
Case insensitive searches can be done with regular expressions, e.g.

match (n:Person) 
where n.name=~'(?i).*a.*' 
return n.name

which would also return results including Andre, andre, Michael

Navrattan Yadav

unread,
Jan 30, 2014, 8:49:16 AM1/30/14
to Neo4J
currently properties is not indexed  with a legacy lucene index.

also i want to seach by a single word either properties has multi word :

like node has name : Peter Neubauer

then it can be search by : Peter 
as well as by : Neubauer


--
You received this message because you are subscribed to a topic in the Google Groups "Neo4j" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/neo4j/fMFBvJID7SI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to neo4j+un...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.



--
Thanks and Regards

Navrattan Yadav

Michael Hunger

unread,
Jan 30, 2014, 9:27:30 AM1/30/14
to ne...@googlegroups.com
That's possible with a legacy fulltext index which also does case insensitive matches.

Michael

Michael Hunger

unread,
Jan 30, 2014, 9:32:16 AM1/30/14
to ne...@googlegroups.com
Yes true.

This will only work well if you have only  a few nodes with that label in your db. Otherwise it will fully scan all nodes and load their properties and then do the check with a regexp all of which is expensive.

Michael

Reply all
Reply to author
Forward
0 new messages