Package org.apache.maven.index
Class DefaultSearchEngine
java.lang.Object
org.apache.maven.index.DefaultSearchEngine
- All Implemented Interfaces:
SearchEngine
A default search engine implementation
- Author:
- Eugene Kuleshov, Tamas Cservenak
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected org.apache.lucene.search.TopScoreDocCollector
doSearchWithCeiling
(AbstractSearchRequest request, org.apache.lucene.search.IndexSearcher indexSearcher, org.apache.lucene.search.Query query) forceSearchFlatPaged
(FlatSearchRequest request, Collection<IndexingContext> indexingContexts) Do the search in all contexts, no matter if the context is searchable or notforceSearchGrouped
(GroupedSearchRequest request, Collection<IndexingContext> indexingContexts) Do the search in all contexts, no matter if the context is searchable or notforceSearchIteratorPaged
(IteratorSearchRequest request, Collection<IndexingContext> indexingContexts) Do the search in all contexts, no matter if the context is searchable or notprotected org.slf4j.Logger
protected NexusIndexMultiReader
getMergedIndexReader
(Collection<IndexingContext> indexingContexts, boolean ignoreContext) Locks down participating contexts, and returns a "merged" reader of them.protected List<IndexingContext>
getParticipatingContexts
(Collection<IndexingContext> indexingContexts, boolean ignoreContext) Returns the list of participating contexts.protected int
getTopDocsCollectorHitNum
(AbstractSearchRequest request, int ceiling) searchFlat
(Comparator<ArtifactInfo> artifactInfoComparator, Collection<IndexingContext> indexingContexts, org.apache.lucene.search.Query query) Deprecated.searchFlat
(Comparator<ArtifactInfo> artifactInfoComparator, IndexingContext indexingContext, org.apache.lucene.search.Query query) Deprecated.protected int
searchFlat
(FlatSearchRequest req, Collection<ArtifactInfo> result, List<IndexingContext> participatingContexts, org.apache.lucene.search.Query query) searchFlatPaged
(FlatSearchRequest request, Collection<IndexingContext> indexingContexts) Do the search only on searchable contextsprotected FlatSearchResponse
searchFlatPaged
(FlatSearchRequest request, Collection<IndexingContext> indexingContexts, boolean ignoreContext) searchGrouped
(GroupedSearchRequest request, Collection<IndexingContext> indexingContexts) Do the search only on searchable contextsprotected GroupedSearchResponse
searchGrouped
(GroupedSearchRequest request, Collection<IndexingContext> indexingContexts, boolean ignoreContext) protected int
searchGrouped
(GroupedSearchRequest req, Map<String, ArtifactInfoGroup> result, Grouping grouping, List<IndexingContext> participatingContexts, org.apache.lucene.search.Query query) searchIteratorPaged
(IteratorSearchRequest request, Collection<IndexingContext> indexingContexts) Do the search only on searchable contexts
-
Constructor Details
-
DefaultSearchEngine
public DefaultSearchEngine()
-
-
Method Details
-
getLogger
protected org.slf4j.Logger getLogger() -
searchFlat
@Deprecated public Set<ArtifactInfo> searchFlat(Comparator<ArtifactInfo> artifactInfoComparator, IndexingContext indexingContext, org.apache.lucene.search.Query query) throws IOException Deprecated.- Specified by:
searchFlat
in interfaceSearchEngine
- Throws:
IOException
-
searchFlat
@Deprecated public Set<ArtifactInfo> searchFlat(Comparator<ArtifactInfo> artifactInfoComparator, Collection<IndexingContext> indexingContexts, org.apache.lucene.search.Query query) throws IOException Deprecated.- Specified by:
searchFlat
in interfaceSearchEngine
- Throws:
IOException
-
searchFlatPaged
public FlatSearchResponse searchFlatPaged(FlatSearchRequest request, Collection<IndexingContext> indexingContexts) throws IOException Description copied from interface:SearchEngine
Do the search only on searchable contexts- Specified by:
searchFlatPaged
in interfaceSearchEngine
- Throws:
IOException
-
forceSearchFlatPaged
public FlatSearchResponse forceSearchFlatPaged(FlatSearchRequest request, Collection<IndexingContext> indexingContexts) throws IOException Description copied from interface:SearchEngine
Do the search in all contexts, no matter if the context is searchable or not- Specified by:
forceSearchFlatPaged
in interfaceSearchEngine
- Throws:
IOException
-
searchFlatPaged
protected FlatSearchResponse searchFlatPaged(FlatSearchRequest request, Collection<IndexingContext> indexingContexts, boolean ignoreContext) throws IOException - Throws:
IOException
-
searchGrouped
public GroupedSearchResponse searchGrouped(GroupedSearchRequest request, Collection<IndexingContext> indexingContexts) throws IOException Description copied from interface:SearchEngine
Do the search only on searchable contexts- Specified by:
searchGrouped
in interfaceSearchEngine
- Throws:
IOException
-
forceSearchGrouped
public GroupedSearchResponse forceSearchGrouped(GroupedSearchRequest request, Collection<IndexingContext> indexingContexts) throws IOException Description copied from interface:SearchEngine
Do the search in all contexts, no matter if the context is searchable or not- Specified by:
forceSearchGrouped
in interfaceSearchEngine
- Throws:
IOException
-
searchGrouped
protected GroupedSearchResponse searchGrouped(GroupedSearchRequest request, Collection<IndexingContext> indexingContexts, boolean ignoreContext) throws IOException - Throws:
IOException
-
searchFlat
protected int searchFlat(FlatSearchRequest req, Collection<ArtifactInfo> result, List<IndexingContext> participatingContexts, org.apache.lucene.search.Query query) throws IOException - Throws:
IOException
-
searchGrouped
protected int searchGrouped(GroupedSearchRequest req, Map<String, ArtifactInfoGroup> result, Grouping grouping, List<IndexingContext> participatingContexts, org.apache.lucene.search.Query query) throws IOException- Throws:
IOException
-
searchIteratorPaged
public IteratorSearchResponse searchIteratorPaged(IteratorSearchRequest request, Collection<IndexingContext> indexingContexts) throws IOException Description copied from interface:SearchEngine
Do the search only on searchable contexts- Specified by:
searchIteratorPaged
in interfaceSearchEngine
- Throws:
IOException
-
forceSearchIteratorPaged
public IteratorSearchResponse forceSearchIteratorPaged(IteratorSearchRequest request, Collection<IndexingContext> indexingContexts) throws IOException Description copied from interface:SearchEngine
Do the search in all contexts, no matter if the context is searchable or not- Specified by:
forceSearchIteratorPaged
in interfaceSearchEngine
- Throws:
IOException
-
doSearchWithCeiling
protected org.apache.lucene.search.TopScoreDocCollector doSearchWithCeiling(AbstractSearchRequest request, org.apache.lucene.search.IndexSearcher indexSearcher, org.apache.lucene.search.Query query) throws IOException - Throws:
IOException
-
getParticipatingContexts
protected List<IndexingContext> getParticipatingContexts(Collection<IndexingContext> indexingContexts, boolean ignoreContext) Returns the list of participating contexts. Does not locks them, just builds a list of them. -
getMergedIndexReader
protected NexusIndexMultiReader getMergedIndexReader(Collection<IndexingContext> indexingContexts, boolean ignoreContext) throws IOException Locks down participating contexts, and returns a "merged" reader of them. In case of error, unlocks as part of cleanup and re-throws exception. Without error, it is the duty of caller to unlock contexts!- Parameters:
indexingContexts
-ignoreContext
-- Returns:
- Throws:
IOException
-
getTopDocsCollectorHitNum
-