title: My .indexOn rule added to Security & Rules isn't taken into account
body: <p>I'm trying to set up custom indexes on my firebase data for sorting on certain fields.</p>
  
  <p>Here is my data: </p>
  
  <p>GET <a href="https://testindexon.firebaseio.com/.json" rel="nofollow">https://testindexon.firebaseio.com/.json</a></p>
  
  <p><code>{
      "key1": {
          "age": 80,
          "name": "zabc"
      },
      "key2": {
          "age": 90,
          "name": "defg"
      },
      "key3": {
          "age": 10,
          "name": "hijk"
      }
  }
  </code></p>
  
  <p>Here are my security rules:</p>
  
  <p><code>{
      "rules": {
          ".read": true,
          ".write": true,
          "testindexon": {
            ".indexOn": "age"
        }
      }
  }
  </code></p>
  
  <p>When I try to orderBy the indexed "age" property, I get an error: </p>
  
  <p>GET <a href="https://testindexon.firebaseio.com/.json?orderBy=" rel="nofollow">https://testindexon.firebaseio.com/.json?orderBy=</a>"age"</p>
  
  <p>Error 400 (Bad request)</p>
  
  <p><code>{
      "error": "Index not defined"
  }
  </code></p>
  
  <p>I can get around the 400 Error by rewriting my security rules as follows:</p>
  
  <p><code>{
      "rules": {
          ".read": true,
          ".write": true,
            ".indexOn": ["age", "name"]
      }
  }
  </code></p>
  
  <p>But then when I try to order by one of the properties, nothing special happens (results aren't sorted): </p>
  
  <p>GET ....firebaseio.com/.json?orderBy="age"</p>
  
  <p><code>{
      "key1": {
          "age": 80,
          "name": "zabc"
      },
      "key2": {
          "age": 90,
          "name": "defg"
      },
      "key3": {
          "age": 10,
          "name": "hijk"
      }
  }
  </code></p>
  
  <p>Am I missing something ? I would appreciate any help. </p>
  
  <p>Best,</p>
  
  <p>State variable</p>