title: Azure CosmosDb: Order-by item requires a range index
body: <p>I'm performing a simple query via the Azure Portal "Query Explorer".</p>
  
  <p>Here is my query:</p>
  
  <pre><code>SELECT * FROM c
  WHERE c.DataType = 'Fruit' 
  AND c.ExperimentIdentifier = 'prod' 
  AND c.Param = 'banana' 
  AND Contains(c.SampleDateTime, '20171029')
  ORDER BY c.SampleDateTime DESC
  </code></pre>
  
  <p>However, I get the exception:</p>
  
  <blockquote>
    <p>Order-by item requires a range index to be defined on the corresponding index path.</p>
  </blockquote>
  
  <p>There is no link to help regarding the error and I cannot make heads from tails, from that error message.</p>
  
  <p>What does it mean, why is my query failing and how can I fix it?</p>
  
  <p><strong>P.S.</strong> the <code>_ts</code> property is no good to me as I do not want to order by the time the records were inserted. </p>