Class TermFilteredPresearcher

java.lang.Object
org.apache.lucene.monitor.Presearcher
org.apache.lucene.monitor.TermFilteredPresearcher
Direct Known Subclasses:
MultipassTermFilteredPresearcher

public class TermFilteredPresearcher extends Presearcher
Presearcher implementation that uses terms extracted from queries to index them in the Monitor, and builds a disjunction from terms in a document to match them.

Handling of queries that do not support term extraction through the QueryVisitor API can be configured by passing a list of CustomQueryHandler implementations.

Filtering by additional fields can be configured by passing a set of field names. Documents that contain values in those fields will only be checked against MonitorQuery instances that have the same fieldname-value mapping in their metadata.

  • Field Details

    • DEFAULT_WEIGHTOR

      public static final TermWeightor DEFAULT_WEIGHTOR
      The default TermWeightor, weighting by token length
  • Constructor Details

    • TermFilteredPresearcher

      public TermFilteredPresearcher()
      Creates a new TermFilteredPresearcher using the default term weighting
    • TermFilteredPresearcher

      public TermFilteredPresearcher(TermWeightor weightor, List<CustomQueryHandler> customQueryHandlers, Set<String> filterFields)
      Creates a new TermFilteredPresearcher
      Parameters:
      weightor - the TermWeightor
      customQueryHandlers - A list of custom query handlers to extract terms from non-core queries
      filterFields - A set of fields to filter on
  • Method Details