private static int getMatchLevel(String[] queryDefintions, String[] indexDefinitions,
      int[] mapping) {
    int qItrLen = queryDefintions.length;
    int indxItrLen = indexDefinitions.length;
    // Asif : We know that because index expressions have matched that
    // itself indicates that the first iterator, which is regon iterator
    // has matched. So the index field position of the first RuntimeIterator
    // of the Query group is 1
    mapping[0] = 1;
    int matchLevel = qItrLen - 1;
    for (int i = 1; i < qItrLen; ++i) {
      for (int j = 1; j < indxItrLen; ++j) {
        if (queryDefintions[i].equals(indexDefinitions[j])) {
          mapping[i] = ++j;
          --matchLevel;
          break;
        }
      }
    }
    if (matchLevel == 0 && indxItrLen > qItrLen) {
      matchLevel = qItrLen - indxItrLen;
    }
    return matchLevel;
  }
Asif : Returns the best available Index based on the available iterators in the Group

TODO: Asif :Check if synchronization is needed while obtaining Array of Indexes as similar to
what we have used during index updates

@param indexType Primary or Range Index
@param definitions String array containing the canonicalized definitions of the Iterators of
       the Group
@param indexedExpression Index Expression path(CompiledValue) on which index needs to be
       created
@param context ExecutionContext object
@return IndexData object
geode-core/src/main/java/org/apache/geode/cache/query/internal/index/IndexManager.java