Class HighlightsMatch


  • public class HighlightsMatch
    extends QueryMatch
    QueryMatch object that contains the hit positions of a matching Query

    If the Query does not support interval iteration (eg, if it gets re-written to a Filter), then no hits will be reported, but an IntervalsQueryMatch will still be returned from an IntervalsMatcher to indicate a match.

    • Constructor Detail

      • HighlightsMatch

        HighlightsMatch​(java.lang.String queryId)
    • Method Detail

      • getHits

        public java.util.Map<java.lang.String,​java.util.Set<HighlightsMatch.Hit>> getHits()
        Returns:
        a map of hits per field
      • getFields

        public java.util.Set<java.lang.String> getFields()
        Returns:
        the fields in which matches have been found
      • getHits

        public java.util.Collection<HighlightsMatch.Hit> getHits​(java.lang.String field)
        Get the hits for a specific field
        Parameters:
        field - the field
        Returns:
        the Hits found in this field
      • getHitCount

        public int getHitCount()
        Returns:
        the total number of hits for the query
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class QueryMatch
      • addHit

        void addHit​(java.lang.String field,
                    int startPos,
                    int endPos,
                    int startOffset,
                    int endOffset)