code: public InternalIndex matchIndex(String pattern, QueryContext.IndexMatchHint matchHint) {
          if (matchHint == QueryContext.IndexMatchHint.EXACT_NAME) {
              return indexesByName.get(pattern);
          } else {
              return attributeIndexRegistry.match(pattern, matchHint);
          }
      }
docs: Matches an index for the given pattern and match hint.
  
  @param pattern   the pattern to match an index for. May be either an
  attribute name or an exact index name.
  @param matchHint the match hint.
  @return the matched index or {@code null} if nothing matched.
  @see QueryContext.IndexMatchHint
  @see Indexes#matchIndex