Package org.apache.lucene.search.matchhighlight

## Class PassageSelector

- java.lang.Object
- - org.apache.lucene.search.matchhighlight.PassageSelector

-     public class PassageSelector
      extends Object

  Selects fragments of text that score best for the given set of highlight markers.

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static Comparator<Passage>` | `DEFAULT_SCORER` |

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `PassageSelector()` |
    `PassageSelector​(Comparator<Passage> passageScorer, PassageAdjuster passageAdjuster)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `List<Passage>` | `pickBest​(CharSequence value, List<? extends OffsetRange> markers, int maxPassageWindow, int maxPassages)` |
    `List<Passage>` | `pickBest​(CharSequence value, List<? extends OffsetRange> markers, int maxPassageWindow, int maxPassages, List<OffsetRange> permittedPassageRanges)` |
    `protected Passage[]` | `pickDefaultPassage​(CharSequence value, int maxCharacterWindow, int maxPassages, List<OffsetRange> permittedPassageRanges)` | Invoked when no passages could be selected (due to constraints or lack of highlight markers).

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### DEFAULT_SCORER

          public static final Comparator<Passage> DEFAULT_SCORER

  - ### Constructor Detail

    - #### PassageSelector

          public PassageSelector()

    - #### PassageSelector

          public PassageSelector​(Comparator<Passage> passageScorer,
                                 PassageAdjuster passageAdjuster)

  - ### Method Detail

    - #### pickBest

          public List<Passage> pickBest​(CharSequence value,
                                        List<? extends OffsetRange> markers,
                                        int maxPassageWindow,
                                        int maxPassages)

    - #### pickBest

          public List<Passage> pickBest​(CharSequence value,
                                        List<? extends OffsetRange> markers,
                                        int maxPassageWindow,
                                        int maxPassages,
                                        List<OffsetRange> permittedPassageRanges)

    - #### pickDefaultPassage

          protected Passage[] pickDefaultPassage​(CharSequence value,
                                                 int maxCharacterWindow,
                                                 int maxPassages,
                                                 List<OffsetRange> permittedPassageRanges)

      Invoked when no passages could be selected (due to constraints or lack of highlight markers).