Class DefaultSearchEngine

  • All Implemented Interfaces:
    SearchEngine

    @Singleton
    @Named
    public class DefaultSearchEngine
    extends java.lang.Object
    implements SearchEngine
    A default search engine implementation
    Author:
    Eugene Kuleshov, Tamas Cservenak
    • Constructor Detail

      • DefaultSearchEngine

        public DefaultSearchEngine()
    • Method Detail

      • getLogger

        protected org.slf4j.Logger getLogger()
      • searchFlat

        @Deprecated
        public java.util.Set<ArtifactInfo> searchFlat​(java.util.Comparator<ArtifactInfo> artifactInfoComparator,
                                                      IndexingContext indexingContext,
                                                      org.apache.lucene.search.Query query)
                                               throws java.io.IOException
        Deprecated.
        Specified by:
        searchFlat in interface SearchEngine
        Throws:
        java.io.IOException
      • searchFlat

        @Deprecated
        public java.util.Set<ArtifactInfo> searchFlat​(java.util.Comparator<ArtifactInfo> artifactInfoComparator,
                                                      java.util.Collection<IndexingContext> indexingContexts,
                                                      org.apache.lucene.search.Query query)
                                               throws java.io.IOException
        Deprecated.
        Specified by:
        searchFlat in interface SearchEngine
        Throws:
        java.io.IOException
      • searchFlat

        protected int searchFlat​(FlatSearchRequest req,
                                 java.util.Collection<ArtifactInfo> result,
                                 java.util.List<IndexingContext> participatingContexts,
                                 org.apache.lucene.search.Query query)
                          throws java.io.IOException
        Throws:
        java.io.IOException
      • searchGrouped

        protected int searchGrouped​(GroupedSearchRequest req,
                                    java.util.Map<java.lang.String,​ArtifactInfoGroup> result,
                                    Grouping grouping,
                                    java.util.List<IndexingContext> participatingContexts,
                                    org.apache.lucene.search.Query query)
                             throws java.io.IOException
        Throws:
        java.io.IOException
      • doSearchWithCeiling

        protected org.apache.lucene.search.TopScoreDocCollector doSearchWithCeiling​(AbstractSearchRequest request,
                                                                                    org.apache.lucene.search.IndexSearcher indexSearcher,
                                                                                    org.apache.lucene.search.Query query)
                                                                             throws java.io.IOException
        Throws:
        java.io.IOException
      • getParticipatingContexts

        protected java.util.List<IndexingContext> getParticipatingContexts​(java.util.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​(java.util.Collection<IndexingContext> indexingContexts,
                                                             boolean ignoreContext)
                                                      throws java.io.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:
        java.io.IOException
      • getTopDocsCollectorHitNum

        protected int getTopDocsCollectorHitNum​(AbstractSearchRequest request,
                                                int ceiling)