Package org.apache.lucene.monitor
Class Presearcher
- java.lang.Object
-
- org.apache.lucene.monitor.Presearcher
-
- Direct Known Subclasses:
TermFilteredPresearcher
public abstract class Presearcher extends java.lang.Object
A Presearcher is used by the Monitor to reduce the number of queries actually run against a Document. It defines how queries are stored in the monitor's internal index, and how a Document is converted to a query against that index.
-
-
Field Summary
Fields Modifier and Type Field Description static Presearcher
NO_FILTERING
A Presearcher implementation that does no query filtering, and runs all registered queries
-
Constructor Summary
Constructors Constructor Description Presearcher()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract Query
buildQuery(LeafReader reader, java.util.function.BiPredicate<java.lang.String,BytesRef> termAcceptor)
Build a query for a Monitor's queryindex from a LeafReader over a set of documents to monitor.abstract Document
indexQuery(Query query, java.util.Map<java.lang.String,java.lang.String> metadata)
Build a lucene Document to index the query in a Monitor's queryindex
-
-
-
Field Detail
-
NO_FILTERING
public static final Presearcher NO_FILTERING
A Presearcher implementation that does no query filtering, and runs all registered queries
-
-
Method Detail
-
buildQuery
public abstract Query buildQuery(LeafReader reader, java.util.function.BiPredicate<java.lang.String,BytesRef> termAcceptor)
Build a query for a Monitor's queryindex from a LeafReader over a set of documents to monitor.- Parameters:
reader
- aLeafReader
over the input documentstermAcceptor
- a predicate indicating if a term should be added to the query- Returns:
- a Query to run over a Monitor's queryindex
-
indexQuery
public abstract Document indexQuery(Query query, java.util.Map<java.lang.String,java.lang.String> metadata)
Build a lucene Document to index the query in a Monitor's queryindex- Parameters:
query
- the Query to indexmetadata
- a Map of arbitrary query metadata- Returns:
- a lucene Document to add to the queryindex
-
-