GraphQuery has() - compare Ignore Case?

1,289 views
Skip to first unread message

dp

unread,
Oct 29, 2014, 2:00:51 AM10/29/14
to gremli...@googlegroups.com
Friends,

How do we use GraphQuery has('classification','Food') function to compare case insensitive?


-thanks in advance,
Dp

Daniel Kuppitz

unread,
Oct 29, 2014, 7:41:37 AM10/29/14
to gremli...@googlegroups.com
Full-text search is case-insensitive. Everything else (String search and exact matches through the Titan index) are case-sensitive. So you can either use a full-text index:

.has("classification", CONTAINS, "Food")

...or a custom filter function (which will be very slow):

.filter { "food".equals(it.getProperty("classification").toLowerCase()) }

Another option is to simply add another property, in your case classfification_lc for example. Create a composite index over this property, then store the lowercase value of classification in it and use it for exact match queries:

.has("classification_lc", "food")

Cheers,
Daniel


--
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/9ac396d3-d357-4c0c-95ea-9d3c77555a58%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages