org.apache.lucene.search

## Class FilteredQuery.FilterStrategy

- java.lang.Object
- - org.apache.lucene.search.FilteredQuery.FilterStrategy

Direct Known Subclasses:
  FilteredQuery.RandomAccessFilterStrategy

Enclosing class:
  FilteredQuery

    public abstract static class FilteredQuery.FilterStrategy
    extends Object

Abstract class that defines how the filter (`DocIdSet`) applied during document collection.

### Constructor Summary

Constructors
Constructor and Description
`FilteredQuery.FilterStrategy()`

### Method Summary

Methods
`abstract Scorer` `filteredScorer(AtomicReaderContext context, boolean scoreDocsInOrder, boolean topScorer, Weight weight, DocIdSet docIdSet)` Returns a filtered `Scorer` based on this strategy.

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

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

### Constructor Detail

#### FilteredQuery.FilterStrategy

    public FilteredQuery.FilterStrategy()

### Method Detail

#### filteredScorer

    public abstract Scorer filteredScorer(AtomicReaderContext context,
                        boolean scoreDocsInOrder,
                        boolean topScorer,
                        Weight weight,
                        DocIdSet docIdSet)
                                   throws IOException

Returns a filtered `Scorer` based on this strategy.

Parameters:
  `context` - the `AtomicReaderContext` for which to return the `Scorer`.
  `scoreDocsInOrder` - specifies whether in-order scoring of documents is required. Note that if set to false (i.e., out-of-order scoring is required), this method can return whatever scoring mode it supports, as every in-order scorer is also an out-of-order one. However, an out-of-order scorer may not support `DocIdSetIterator.nextDoc()` and/or `DocIdSetIterator.advance(int)`, therefore it is recommended to request an in-order scorer if use of these methods is required.
  `topScorer` - if true, `Scorer.score(Collector)` will be called; if false, `DocIdSetIterator.nextDoc()` and/or `DocIdSetIterator.advance(int)` will be called.
  `weight` - the `FilteredQuery` `Weight` to create the filtered scorer.
  `docIdSet` - the filter `DocIdSet` to apply
Returns:
  a filtered scorer
Throws:
  `IOException` - if an `IOException` occurs