How to stop couchbase to keep searching n1ql query

hi

I want to stop couchbase for searching too long if its not be able to find the record lets say in 5 sec max . Right now sometimes application got hanged because couchbase is searching in background (I guess) . Is there any way to stop this behavior.

i tired this but its not stop it in 1 sec
‘couchbase://’.DB_SERVER_IP.’?n1ql_timeout=1&fetch_mutation_tokens=true’;

Thanks

set timeout https://docs.couchbase.com/server/current/settings/query-settings.html