looking for some solutions? You are welcome.

SOLVED: Wath is wrong with this couchbase index?

Lho Ben:

i created this couchbase index

CREATE INDEX `idx_additionalOrderCode` ON 
`order`(ALL ARRAY s.`value` FOR s IN additionalOrderCode WHEN s.`typeCode`= "MYCODE" END)
WHERE _class = "com.entrprise.OrderEntity" 

based on the example in this page


but when i query this index with this select query :

SELECT * FROM `order` 
WHERE `_class` = "com.entrprise.OrderEntity" 
AND ANY s IN additionalOrderCode SATISFIES ( s.`value` = "130047777" ) and (s.typeCode = "MYCODE" ) END

i get the error

 "msg": "No index available on keyspace order that matches your query. Use CREATE INDEX or CREATE PRIMARY INDEX to create an index, or check that your expected index is online."

No primary index is backing the query, i want all my queries to be backed by secondary indexes.

I am using Enterprise Edition 6.0.0 build 1693

Thanks for your help

Posted in S.E.F
via StackOverflow & StackExchange Atomic Web Robots

No comments: