check if a word in a list - case insenstive

38 views
Skip to first unread message

devh...@gmail.com

unread,
Feb 12, 2019, 5:46:06 AM2/12/19
to Neo4j

Hi,

I am having issues caused by case sensitive matches ,
can someone please help ?

here is my query:
 
MATCH (e1:Entity), (e2:Entity) WHERE e1.Word in e2.WordsList and e1.Word ={name}

Word is a string
WordsList is List<string>

how can I ignore the case when checking if a word is inside a list ?


Thanks

Michael Hunger

unread,
Feb 12, 2019, 5:49:35 AM2/12/19
to ne...@googlegroups.com
it's expensive and you need to do

WHERE toLower(e1.word) IN [w in e2.WordsList | toLower(w)] 

or

WHERE ANY(w IN e2.WordsList WHERE toLower(e1.word) toLower(w))


you can also store lower case words in your properties, or add a 2nd property to check for that.

--
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/d/optout.

dev hero

unread,
Feb 12, 2019, 2:15:18 PM2/12/19
to ne...@googlegroups.com
Thanks Michael, that seems solved my issue.

Reply all
Reply to author
Forward
0 new messages