Optimize Query to get 30 ms performance . Array indexing

n1ql

#1

I have a real time sla for text search queries of not greater than 30 ms.
I have 400 thousand documents. I have regex search queries of the type
any 3 letters of firtname like MAT and any four letters of last name like DLLS.
the global secondary indexes take far too too much time as its a like '%search% for all these kind of regex.
and also Full text search also take over 100 ms just to return Ids . . . as its a regexp search with multiple criteria
so i want to split all the fields by length and add indexes and use them when searching . . .
Hemanth in a first name needs to be split as [Hem , ema , man , nth] and indexed< Array index >
and i want to use a query to access it in the same way.
how do i do i it .i cannot alter the structure of json documents


#2

Follow technique described here. https://dzone.com/articles/a-couchbase-index-technique-for-like-predicates-wi