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
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionprotected org.apache.lucene.search.TopScoreDocCollectordoSearchWithCeiling(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.Loggerprotected NexusIndexMultiReadergetMergedIndexReader(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 intgetTopDocsCollectorHitNum(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 intsearchFlat(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 FlatSearchResponsesearchFlatPaged(FlatSearchRequest request, Collection<IndexingContext> indexingContexts, boolean ignoreContext) searchGrouped(GroupedSearchRequest request, Collection<IndexingContext> indexingContexts) Do the search only on searchable contextsprotected GroupedSearchResponsesearchGrouped(GroupedSearchRequest request, Collection<IndexingContext> indexingContexts, boolean ignoreContext) protected intsearchGrouped(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:
 searchFlatin 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:
 searchFlatin interfaceSearchEngine- Throws:
 IOException
 - 
searchFlatPaged
public FlatSearchResponse searchFlatPaged(FlatSearchRequest request, Collection<IndexingContext> indexingContexts) throws IOException Description copied from interface:SearchEngineDo the search only on searchable contexts- Specified by:
 searchFlatPagedin interfaceSearchEngine- Throws:
 IOException
 - 
forceSearchFlatPaged
public FlatSearchResponse forceSearchFlatPaged(FlatSearchRequest request, Collection<IndexingContext> indexingContexts) throws IOException Description copied from interface:SearchEngineDo the search in all contexts, no matter if the context is searchable or not- Specified by:
 forceSearchFlatPagedin 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:SearchEngineDo the search only on searchable contexts- Specified by:
 searchGroupedin interfaceSearchEngine- Throws:
 IOException
 - 
forceSearchGrouped
public GroupedSearchResponse forceSearchGrouped(GroupedSearchRequest request, Collection<IndexingContext> indexingContexts) throws IOException Description copied from interface:SearchEngineDo the search in all contexts, no matter if the context is searchable or not- Specified by:
 forceSearchGroupedin 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:SearchEngineDo the search only on searchable contexts- Specified by:
 searchIteratorPagedin interfaceSearchEngine- Throws:
 IOException
 - 
forceSearchIteratorPaged
public IteratorSearchResponse forceSearchIteratorPaged(IteratorSearchRequest request, Collection<IndexingContext> indexingContexts) throws IOException Description copied from interface:SearchEngineDo the search in all contexts, no matter if the context is searchable or not- Specified by:
 forceSearchIteratorPagedin 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
 
 -