1

I'm using CosmosDB's V3 API. I set PopulateIndexMetrics to true to generate index recommendations. However, some of the recommendations (relating to arrays) seem to be in an unsupported format and when I try and add them as is (to my containers' indexes) the operation fails.

Here is an example composite index recommendation which I get when I set PopulateIndexMetrics to true (where a and c are simple string properties and b is an array of strings):

Index Spec: "/a ASC, /b/[] ASC, /c ASC\r\n"

However, this array format isn't supported when I try and add this composite index via the Azure Portal. And I've already added this to the index: "/a ASC, /b ASC, /c ASC" (I removed the square parantheses) yet when I rerun the index recommender it still re-recommends the missing index with the unsupported format.

Any help would be appreciated.

Thanks!

1 Answer 1

0

I'm unsure why PopulateIndexMetrics would make such a suggestion, but a composite index can only include scalar values.

Composite paths lead to a scalar value that is the only value included in the composite index.

As found in the Microsoft Docs

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.