Package org.apache.lucene.monitor
Class Presearcher
java.lang.Object
org.apache.lucene.monitor.Presearcher
- Direct Known Subclasses:
TermFilteredPresearcher
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
Modifier and TypeFieldDescriptionstatic final Presearcher
A Presearcher implementation that does no query filtering, and runs all registered queries -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract Query
buildQuery
(LeafReader reader, BiPredicate<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, Map<String, String> metadata) Build a lucene Document to index the query in a Monitor's queryindex
-
Field Details
-
NO_FILTERING
A Presearcher implementation that does no query filtering, and runs all registered queries
-
-
Constructor Details
-
Presearcher
public Presearcher()
-
-
Method Details
-
buildQuery
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
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
-