TL;DR;
Hash indexing is dead, long live Range indexing

I recently did a DocumentBD talk for NNUG in Oslo, and made a discovery during my preparation of a demo on indexing.

The default index configuration when creating a collection in the portal differs from creating one with the API and also the documentation. Both the API and Documentation follows the "old" indexing settings[1] but this will show up as Custom in the portal.

Creating a collection using the portal, the new default is range for both string and numbers. It will also display as default settings in the portal.

defaultindexing
Another observation is the new default indexing for the point datatype, points will now by default be indexed for spatial searchs.

I've reached out to the DocumentDB team, and apperantly they are changing the indexing a bit. As far as I understand they have optimized the storage for range, so that the difference between hash and range are very small. This may lead to the deprecation of hash indexing. This is a good thing, a simple product means less developer surprises and frustration.

In my dream world, this is a step on the road to skip and take functionality. The DocumentDB closely monitors our wishlist, so please take your time to upvote skip/take here.

[1] Code for old/API indexing settings,

{
  "indexingMode": "consistent",
  "automatic": true,
  "includedPaths": [
    {
      "path": "/*",
      "indexes": [
        {
          "kind": "Range",
          "dataType": "Number",
          "precision": -1
        },
        {
          "kind": "Hash",
          "dataType": "String",
          "precision": 3
        }
      ]
    }
  ],
  "excludedPaths": []
}

[2]New indexing settings

{
  "indexingMode": "consistent",
  "automatic": true,
  "includedPaths": [
    {
      "path": "/*",
      "indexes": [
        {
          "kind": "Range",
          "dataType": "Number",
          "precision": -1
        },
        {
          "kind": "Range",
          "dataType": "String",
          "precision": -1
        },
        {
          "kind": "Spatial",
          "dataType": "Point"
        }
      ]
    }
  ],
  "excludedPaths": []
}