Regexp i switch stops working suddenly

Moved from GitHub dgraph/5214

Posted by nadeemnazeer3:

I Have a trigram index on one of my predicates to allow me do case insensitive match using regexp. But issue is when i do
regexp(TITLE, /Some Term/i)
It won’t return any results ?
If i do without “i” like this It does return results!?
regexp(TITLE, /Some Term/)
Initially i faced this when i was testing via setting up dgraph via docker; but now it got even triggered suddenly on server as well after I loaded some more data.
e.g:

{    
  term(func:  regexp(TITLE, /Nadeem N/i)) {
   name: TITLE
   tag
    }
}

It won’t return me anything ; only after i remove /i it does
with schema

<TITLE>: string @index(exact, trigram) .

Dgraph version : v1.2.1
Dgraph SHA-256 : 3f18ff84570b2944f4d75f6f508d55d902715c7ca2310799cc2991064eb046f8
Commit SHA-1 : ddcda9296
Commit timestamp : 2020-02-06 15:31:05 -0800
Branch : HEAD
Go version : go1.13.5

MichelDiz commented :

Can you provide a sample? is it “Nadeem N” what? I wanna try to reproduce it.
Also, you should upgrade to a latest version, there are a lot of commits ahead.

{
  set {
    _:Nadeem <TITLE> "Nadeem N" .
    _:Nadeem <tag> "test" .
  }
}

BTW, what is STR?

nadeemnazeer3 commented :

What i find is it gets triggered while more data load on same predicate; i have one more server everything fine till now but i am sure if i try to load the new data; above issue may trigger.
And other thing is after above load; when i tried the query at first it appeared to work ; i tried same query it stopped working…
Sorry STR was one more predicate like TITLE; updated the comment.
I upgraded to latest dgraph on my test server - same issue triggered while new load.

Issue seems related to: regexp i switch not working · Issue #5131 · dgraph-io/dgraph · GitHub
If i try /^Nade*/i - it works but /^Nadee*/i won’t.