Question:
You have to ensure the following query can be executed:
select * from customers order by customername, city asc
You have to define a policy for this:
{
"automatic": true,
"indexingMode": "Consistent",
"includedPaths": [{ "path": "/*" }],
"excludedPaths": []
/* Code here */
}
Answer:
Queries that have an ORDER BY clause with two or more properties require a composite index.
{
"automatic": true,
"indexingMode": "Consistent",
"includedPaths": [{ "path": "/*" }],
"excludedPaths": [],
"compositeIndexes": [
[
{
"path": "/city",
"order": "ascending"
},
{
"path": "/customername",
"order": "descending"
}
]
]
}