Q:

Couchbase : querying with Nickel using indexes, but the indexes do not get updated immediatel

I am facing a problem here I am querying Couchbase using Nickel and my query is 
SELECT  *        
FROM `user`
USE INDEX (ord_ts_new_idx USING GSI)
WHERE META(`user`).id LIKE 'ord::27::%'
ORDER BY ts DESC
OFFSET 0 LIMIT 5;

But here the value that I am getting is not updated, But If I make the same request after sometime It gives me the desired output. 
The query that I have used for making the INDEX is 
CREATE INDEX ord_ts_new_idx ON `user-account`(`ts`) USING GSI;

where ts is the TimeStamp.
So could you please tell me if there is a way in which, I can get the updated data always?
Thanks in advance. Any type of help is appreciated.

A:

You do not mention which SDK you are using, but client SDK are you using? N1QL provides a scan_consistency parameter, so it's a matter of making sure your client SDK uses this. So go here and find your language of choice. For example, here is the Java SDK section, look under "read your own write."
Just be forewarned that by doing this for everything, you could very well take a performance penalty as the index will need to be refreshed before serving your results. So make sure you test this please.

