public InternalIndex match ( String attribute , QueryContext . IndexMatchHint matchHint ) { Record record = registry . get ( attribute ) ; if ( record == null ) { return null ; } switch ( matchHint ) { case NONE : // Intentional fallthrough. We still prefer ordered indexes // under the cover since they are more universal in terms of // supported fast queries. case PREFER_ORDERED : InternalIndex ordered = record . ordered ; return ordered == null ? record . unordered : ordered ; case PREFER_UNORDERED : InternalIndex unordered = record . unordered ; return unordered == null ? record . ordered : unordered ; default : throw new IllegalStateException ( "unexpected match hint: " + matchHint ) ; } }
Matches an index for the given attribute and match hint .