J
JanusGraphโ€ข17mo ago
criminosis

Case Insensitive TextRegex?

Is there a way to convey a text insensitivity to a textRegex Regex without doing a per character index enumeration of casing? E.g. I'd normally make a regex like "(?i)foobar" (or pass to an explicit flags parameter in the regex builder) to match FOOBAR, Foobar, etc. But it seems like I have to do textRegex("[Ff][Oo][Oo][Bb][Aa][Rr]") to proxy that functionality?
4 Replies
Florian Hockmann
Florian Hockmannโ€ข17mo ago
JanusGraph basically just forwards these regular expressions to your index backends. So we are limited by what the index backends support. They used to not support case insensitive searches for regular expressions, but I just checked again and it looks like at least Elasticsearch added support for that in version 7.10.0: https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-term-query.html#term-field-params I think we should add support for that into JanusGraph somehow. If you want, you can create an issue for that in the main JanusGraph repo
Florian Hockmann
Florian Hockmannโ€ข17mo ago
Note that the full-text search predicates like textContainsRegex are apparently already case-insensitive by default, probably due to the tokenization: https://docs.janusgraph.org/index-backend/text-search/#full-text-search_1 But since you mentioned textRegex, this doesn't apply here
criminosis
criminosisโ€ข17mo ago
Created @florianhockmann ๐Ÿ‘ . Should I mark your message as the solution since it's now a feature request for a later date? https://github.com/JanusGraph/janusgraph/issues/3878
GitHub
Case insensitive textRegex predicate option ยท Issue #3878 ยท JanusGr...
Describe the feature: Currently textRegex applies a case sensitive matching by default. In my particular use case I'm using Elasticsearch as my mixed index backend, and it is case sensitive by ...
Florian Hockmann
Florian Hockmannโ€ข17mo ago
Sure you can do that ๐Ÿ™‚
Want results from more Discord servers?
Add your server