Interface MatchHighlighter.FieldValueHighlighter

    • Method Detail

      • isApplicable

        boolean isApplicable​(java.lang.String field,
                             boolean hasMatches)
        Check if this highlighter can be applied to a given field.
        Parameters:
        field - Field name
        hasMatches - true if the field has a non-empty set of match regions.
      • format

        java.util.List<java.lang.String> format​(java.lang.String field,
                                                java.lang.String[] values,
                                                java.lang.String contiguousValue,
                                                java.util.List<OffsetRange> valueRanges,
                                                java.util.List<MatchHighlighter.QueryOffsetRange> matchOffsets)
        Do format field values appropriately.
      • alwaysFetchedFields

        default java.util.Collection<java.lang.String> alwaysFetchedFields()
        Returns:
        Returns a set of fields that must be fetched for each document, regardless of whether they had matches or not. This is useful to load and return certain fields that should always be included (identifiers, document titles, etc.).