Java N1ql query timesout, Workbench runs under 15ms

I’m not sure why java SDK query times out (60seconds) while Query Workbench runs the same query in 15ms.
I have this index:
create index feature_userid_idx ON dummy_bucket (DISTINCT ARRAY (DISTINCT ARRAY (DISTINCT ARRAY [feature.featureUserIdentifier.issuer,feature.featureUserIdentifier.domain,feature.featureUserIdentifier.type,] FOR feature IN enrollInfo.features end) FOR enrollInfo IN app.enrollmentInfoList end) FOR app IN OBJECT_VALUES(dummy_bucket.apps) end) using gsi

Here is the query:
SELECT *, meta(dummy_bucket) FROM dummy_bucket WHERE ANY app IN OBJECT_VALUES(dummy_bucket.apps) SATISFIES ANY enrollInfo IN app.enrollmentInfoList SATISFIES ANY feature IN enrollInfo.features SATISFIES [feature.featureUserIdentifier.issuer, feature.featureUserIdentifier.domain, feature.featureUserIdentifier.type,] = [“001”, “dummy”, “dummy”, “dummy”] END END END

Java query:
Bucket.query(N1qlQuery.simple(“above query”))

What am I doing incorrectly?


Not sure why Java SDK query times out.

  1. In create index Change OBJECT_VALUES(dummy_bucket.apps) TO OBJECT_VALUES(apps). If you use bucket name it expecting that is field in the document.
  2. You can do EXPLAIN inside JAVA SDK and look into the plan.

thanks for replying @vsr1 much appreciated. one of our cluster indexing servers didn’t have the new index that I created. It worked once I added it.