datastax graph Search.tokenRegex('.*sea.*in.*')

42 views
Skip to first unread message

אלה וייס

unread,
Jul 19, 2016, 7:51:23 AM7/19/16
to Aurelius
How can I change the query in order to get the following results



Season in 

Season 

Sea in sssss

in AAAAA

bbbSEAaaain


Daniel Kuppitz

unread,
Jul 19, 2016, 9:16:30 AM7/19/16
to aureliu...@googlegroups.com
You obviously don't care about tokens, hence just use Search.regex instead of Search.tokenRegex.

Cheers,
Daniel


--
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 aureliusgraph...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/aureliusgraphs/d8b0c9ae-ad9d-4602-bc01-d0d7ec8846bb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

אלה וייס

unread,
Jul 20, 2016, 2:03:32 AM7/20/16
to Aurelius
In case I want the following results to search John Smith

john smith

John Smith

JOHN SMITH

John

Smith

In that case I need the search to ignore lower case and upper case and get all results, and Also to get only John or Only Smith



בתאריך יום שלישי, 19 ביולי 2016 בשעה 14:51:23 UTC+3, מאת אלה וייס:

Daniel Kuppitz

unread,
Jul 20, 2016, 4:35:08 AM7/20/16
to aureliu...@googlegroups.com
Well, that's more of a regex question and not really graph / query realted. But here you go:

gremlin> g.inject(["john smith", "John Smith", "JOHN SMITH", "John", "Smith", "no match"]).unfold().is(Search.regex(".*ohn.*smi.*"))
==>john smith
gremlin> g.inject(["john smith", "John Smith", "JOHN SMITH", "John", "Smith", "no match"]).unfold().is(Search.regex("(?i).*ohn.*smi.*"))
==>john smith
==>John Smith
==>JOHN SMITH
gremlin> g.inject(["john smith", "John Smith", "JOHN SMITH", "John", "Smith", "no match"]).unfold().is(Search.regex("(?i).*(ohn|smi).*"))
==>john smith
==>John Smith
==>JOHN SMITH
==>John
==>Smith
gremlin>


Cheers,
Daniel


--
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 aureliusgraph...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages