code: public static Comparator<CompositeScore<?>> localForeignComparator(QueryHints hints) {
          if (hints != null && hints.contains(QueryHint.CONSUME_SLICE)) {
              return Comp.LOCAL_FOREIGN_SLICE;
          }
          return Comp.LOCAL_FOREIGN;
      }
docs: Returns a partial comparator suited for comparing local indexes to
  foreign indexes. It determines which CompositeScores are better by
  examining identity matches, range matches and ordering. It does not
  matter if the scores were evaluated for different indexes or storable
  types. The comparator returns {@code <0} if first score is better,
  {@code 0} if equal, or {@code >0} if second is better.
  
  @param hints optional hints