java.lang.Object
org.apache.lucene.facet.FacetsCollectorManager
- All Implemented Interfaces:
CollectorManager<FacetsCollector,
FacetsCollector>
public class FacetsCollectorManager
extends Object
implements CollectorManager<FacetsCollector,FacetsCollector>
A
CollectorManager
implementation which produces FacetsCollector and produces a merged
FacetsCollector. This is used for concurrent FacetsCollection.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Holds results of a search run via static utility methods exposed by this class.private static class
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSole constructor.FacetsCollectorManager
(boolean keepScores) Creates a new collector manager that in turn createsFacetsCollector
using the providedkeepScores
flag. -
Method Summary
Modifier and TypeMethodDescriptionprivate static FacetsCollectorManager.FacetsResult
doSearch
(IndexSearcher searcher, ScoreDoc after, Query q, int n, Sort sort, boolean doDocScores, FacetsCollectorManager fcm) Return a newCollector
.reduce
(Collection<FacetsCollector> collectors) Reduce the results of individual collectors into a meaningful result.search
(IndexSearcher searcher, Query q, int n, FacetsCollectorManager fcm) Utility method, to search and also populate aFacetsCollector
with hits.search
(IndexSearcher searcher, Query q, int n, Sort sort, boolean doDocScores, FacetsCollectorManager fcm) Utility method, to search and also populate aFacetsCollector
with hits.search
(IndexSearcher searcher, Query q, int n, Sort sort, FacetsCollectorManager fcm) Utility method, to search and also populate aFacetsCollector
with hits.searchAfter
(IndexSearcher searcher, ScoreDoc after, Query q, int n, FacetsCollectorManager fcm) Utility method, to search and also populate aFacetsCollector
with hits.searchAfter
(IndexSearcher searcher, ScoreDoc after, Query q, int n, Sort sort, boolean doDocScores, FacetsCollectorManager fcm) Utility method, to search and also populate aFacetsCollector
with hits.searchAfter
(IndexSearcher searcher, ScoreDoc after, Query q, int n, Sort sort, FacetsCollectorManager fcm) Utility method, to search and also populate aFacetsCollector
with hits.
-
Field Details
-
keepScores
private final boolean keepScores
-
-
Constructor Details
-
FacetsCollectorManager
public FacetsCollectorManager()Sole constructor. -
FacetsCollectorManager
public FacetsCollectorManager(boolean keepScores) Creates a new collector manager that in turn createsFacetsCollector
using the providedkeepScores
flag. hits.
-
-
Method Details
-
newCollector
Description copied from interface:CollectorManager
Return a newCollector
. This must return a different instance on each call.- Specified by:
newCollector
in interfaceCollectorManager<FacetsCollector,
FacetsCollector> - Throws:
IOException
-
reduce
Description copied from interface:CollectorManager
Reduce the results of individual collectors into a meaningful result. For instance aTopDocsCollector
would compute thetop docs
of each collector and then merge them usingTopDocs.merge(int, TopDocs[])
. This method must be called after collection is finished on all provided collectors.- Specified by:
reduce
in interfaceCollectorManager<FacetsCollector,
FacetsCollector> - Throws:
IOException
-
search
public static FacetsCollectorManager.FacetsResult search(IndexSearcher searcher, Query q, int n, FacetsCollectorManager fcm) throws IOException Utility method, to search and also populate aFacetsCollector
with hits. The providedFacetsCollectorManager
will be used for creating/reducingFacetsCollector
instances.- Throws:
IOException
-
search
public static FacetsCollectorManager.FacetsResult search(IndexSearcher searcher, Query q, int n, Sort sort, FacetsCollectorManager fcm) throws IOException Utility method, to search and also populate aFacetsCollector
with hits. The providedFacetsCollectorManager
will be used for creating/reducingFacetsCollector
instances.- Throws:
IOException
-
search
public static FacetsCollectorManager.FacetsResult search(IndexSearcher searcher, Query q, int n, Sort sort, boolean doDocScores, FacetsCollectorManager fcm) throws IOException Utility method, to search and also populate aFacetsCollector
with hits. The providedFacetsCollectorManager
will be used for creating/reducingFacetsCollector
instances.- Throws:
IOException
-
searchAfter
public static FacetsCollectorManager.FacetsResult searchAfter(IndexSearcher searcher, ScoreDoc after, Query q, int n, FacetsCollectorManager fcm) throws IOException Utility method, to search and also populate aFacetsCollector
with hits. The providedFacetsCollectorManager
will be used for creating/reducingFacetsCollector
instances.- Throws:
IOException
-
searchAfter
public static FacetsCollectorManager.FacetsResult searchAfter(IndexSearcher searcher, ScoreDoc after, Query q, int n, Sort sort, FacetsCollectorManager fcm) throws IOException Utility method, to search and also populate aFacetsCollector
with hits. The providedFacetsCollectorManager
will be used for creating/reducingFacetsCollector
instances.- Throws:
IOException
-
searchAfter
public static FacetsCollectorManager.FacetsResult searchAfter(IndexSearcher searcher, ScoreDoc after, Query q, int n, Sort sort, boolean doDocScores, FacetsCollectorManager fcm) throws IOException Utility method, to search and also populate aFacetsCollector
with hits. The providedFacetsCollectorManager
will be used for creating/reducingFacetsCollector
instances.- Throws:
IOException
-
doSearch
private static FacetsCollectorManager.FacetsResult doSearch(IndexSearcher searcher, ScoreDoc after, Query q, int n, Sort sort, boolean doDocScores, FacetsCollectorManager fcm) throws IOException - Throws:
IOException
-