public IndexData getBestMatchIndex(String regionPath, String[] definitions, IndexType indexType,
      CompiledValue indexedExpression, ExecutionContext context)
      throws TypeMismatchException, NameResolutionException {
    Region region = cache.getRegion(regionPath);
    if (region == null) {
      return null;
    }
    // return getBestMatchIndex(region, indexType, definitions,
    // indexedExpression);
    IndexManager indexManager = IndexUtils.getIndexManager(cache, region, false);
    if (indexManager == null) {
      return null;
    }
    return indexManager.getBestMatchIndex(indexType, definitions, indexedExpression, context);
  }
Asif: Gets a best match index which is available. An index with match level equal to 0 is the
best index to use as it implies that the query from clause iterators belonging to the region
exactly match the index from clause iterators ( the difference in the relative positions of the
iterators do not matter). A match level less than 0 means that number of iteratots in the index
resultset is more than that present in the query from clause and hence index resultset will
need a cutdown. A match level greater than 0 means that there definitely is atleast one
iterator in the query from clause which is more than the index from clause iterators & hence
definitely expansion of index results will be needed. Pls note that a match level greater than
0 does not imply that index from clause does not have an extra iterator in it , too. Hence a
match level greater than 0 will definitely mean expansion of index results but may also require
a cut down of results . The order of preference is match level 0 , less than 0 and lastly
greater than 0

@param regionPath String containing the region name
@param definitions An array of String objects containing canonicalized definitions of
       RuntimeIterators. A Canonicalized definition of a RuntimeIterator is the canonicalized
       expression obtainded from its underlying collection expression.
@param indexType IndexType object which can be either of type RangeIndex or PrimaryKey Index
@param indexedExpression CompiledValue representing the path expression 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/DefaultQueryService.java