azure - Different type of indexings on same field of a document in DocumentDb -


i have collection documents have different kind of properties strings, numbers, datetimes.

and indexing policy have following:

  {   "indexingmode": "consistent",   "automatic": true,   "includedpaths": [     {       "path": "/*",       "indexes": [         {           "kind": "range",           "datatype": "number",           "precision": -1         },         {           "kind": "hash",           "datatype": "string",           "precision": 3         }       ]     }   ],   "excludedpaths": [] } 

now want, adding range type indexing on string fields well. edited indexing policy like:

 {   "indexingmode": "consistent",   "automatic": true,   "includedpaths": [     {       "path": "/*",       "indexes": [         {           "kind": "range",           "datatype": "number",           "precision": -1         },         {           "kind": "hash",           "datatype": "string",           "precision": 3         },         {           "kind": "range",           "datatype": "string",           "precision": 20         }       ]     }   ],   "excludedpaths": [] } 

but did not work :(

i know multiple type indexing can added on field. can have idea how that?

for given data type, can have 1 index type (hash or range) specified path. range superset of hash in terms of queries supported. hash supports equality queries, range supports equality, range, , order queries.

so need remove json block hash on string, e.g. following , indexing policy update succeed:

 {   "indexingmode": "consistent",   "automatic": true,   "includedpaths": [     {       "path": "/*",       "indexes": [         {           "kind": "range",           "datatype": "number",           "precision": -1         },         {           "kind": "range",           "datatype": "string",           "precision": 20         }       ]     }  ],   "excludedpaths": [] } 

Comments

Popular posts from this blog

'hasOwnProperty' in javascript -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -

How to understand 2 main() functions after using uftrace to profile the C++ program? -