Query search like %search%

Hi,

I have a bucket with lots of documents, I store the info about users, so I have names and more information. I want to make a query to find users who match with a name, so i tried to user "where name like “%search%”, but it takes much time, I’ve been reading about how I can make this search faster but I’ve not found a solution yet, I tried with full text search, but I need the whole words.
example: name:“john smith” -> i want to find the previous user if i put “joh”.

Thanks

With couchbase 6.5, you can code in a N1QL query to search from a full text search index (which needs to be made available ). For example, if you’ve a full text index with the “name” field in your documents indexed, here’s your N1QL query for it …

SELECT meta().id
FROM `bucket` as b
WHERE SEARCH(b, {"match": "joh smith", "field": "name", "fuzziness": 1});

This embedded full text query will match “john smith”, “joh smith”, “john smit”, etc. as the edit distance for the search term is set to 1 via "fuzziness": 1.

Here’s some documentation on how you can execute full text search requests from within N1QL …
https://docs.couchbase.com/server/6.5/n1ql/n1ql-language-reference/searchfun.html

@vsr1 @abhinav thanks