Titan 1.0 Gremlin 3.01 - How to use ignore case text search with Regex ???

91 views
Skip to first unread message

Vitaly Tarasiuk

unread,
Nov 10, 2016, 10:38:41 AM11/10/16
to Aurelius, gremli...@googlegroups.com
Hi all,

I'm working on Titan 1.0 using Text Regex search with Elastic search 2.X, 

gremlin> Titan.version()
==>1.0.0
gremlin
> Gremlin.version()
==>3.0.1-incubating


I wonder how can i use ignore case sensitive with search...

found that prefix at the beggining can solve but it doesn't work !!!!

gremlin>
gremlin>
gremlin> graph.V().has("openPositionTitleXXXX" ,textRegex(".*Web Client.*")).valueMap('openPositionTitleXXXX')
==>[openPositionTitleXXXX:[Web Client Developer]]
==>[openPositionTitleXXXX:[Web Client Developer]]
gremlin>
gremlin>
gremlin>
gremlin> graph.V().has("openPositionTitleXXXX" ,textRegex(".*web Client.*")).valueMap('openPositionTitleXXXX')
gremlin>
gremlin> graph.V().has("openPositionTitleXXXX" ,textRegex("(?i).*web Client.*")).valueMap('openPositionTitleXXXX')
gremlin>
gremlin>
gremlin>
gremlin> graph.V().has("openPositionTitleXXXX" ,textRegex("(?i)Web Client.*")).valueMap('openPositionTitleXXXX')



Please advice

BR,

Vitaly

thomas prelle

unread,
Nov 11, 2016, 4:49:55 AM11/11/16
to Aurelius, gremli...@googlegroups.com
Hi,

Lucene do not allow to do it simply, so ES and Titan also.
I think the only way it's to do it yourself.

This query should work :
graph.V().has("openPositionTitleXXXX" ,textRegex(".*[w|W][e|E][b|B] [c|C][l|L][i|I][e|E][n|N][t|T].*")).valueMap('openPositionTitleXXXX')

Thomas

Vitaly Tarasiuk

unread,
Nov 11, 2016, 6:50:32 AM11/11/16
to Aurelius, gremli...@googlegroups.com
Hi, 

Saw this link , about the same issue,


does it mean that the "ignore case" feature supported only after titan 1.1 ?? 



About your answer , I don't understand why ..., according their docs:


"titanRegex" is using internally Regex , and what i do is pure regex functionality - "(?i)regexPattern".

So i need to process each phrase into lower/uppercase template , a lot of overhead , don't you think ?..


Thanks



--
You received this message because you are subscribed to the Google Groups "Aurelius" group.
To unsubscribe from this group and stop receiving emails from it, send an email to aureliusgraphs+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/aureliusgraphs/4cf344fa-d652-414b-899d-c81700311732%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Austin Sharp

unread,
Nov 11, 2016, 1:29:48 PM11/11/16
to Aurelius, gremli...@googlegroups.com
The Github label probably just means they'd like to get it done for Titan 1.1.

We also manually make our regexes case-insensitive as described by Thomas Prelle, because we use ElasticSearch for our index. If you make an internal Titan index then it'll use Java regexes and (?i) will work, but not for an ES index.
To unsubscribe from this group and stop receiving emails from it, send an email to aureliusgraph...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages