degu.searcher.ejb
Class DocumentIndexSearcher

java.lang.Object
  extended by degu.searcher.ejb.DocumentIndexSearcher

public class DocumentIndexSearcher
extends java.lang.Object

Frontend for searching a Lucene Index This retriever expects following fields within the index:

  • Field("orig-file-name", origFileName, Field.Store.YES, Field.Index.UN_TOKENIZED)
  • Field("contents", rawText, Field.Store.NO, Field.Index.TOKENIZED)

  • Field Summary
    (package private)  org.apache.lucene.analysis.Analyzer analyzer
               
    (package private)  LuceneIndexDescriptor docIdxDesc
               
    (package private)  org.apache.lucene.search.highlight.Formatter formatter
               
    (package private) static int FRAGMENT_SIZE
               
    (package private)  org.apache.lucene.search.highlight.SimpleFragmenter fragmenter
               
    (package private)  org.apache.lucene.search.highlight.Highlighter high
               
    (package private)  org.apache.lucene.index.IndexReader indexReader
               
    (package private)  org.apache.lucene.search.IndexSearcher indexSearcher
               
    (package private) static org.jboss.logging.Logger logger
               
    (package private) static int MAX_BEST_FRAGMENTS
               
    (package private) static int MAX_BYTES_TO_ANALYZE
               
    (package private) static int MAX_HITS
               
    (package private)  LuceneIndexDescriptor pageIdxDesc
               
    (package private)  org.apache.lucene.index.IndexReader pageIndexReader
               
    (package private)  org.apache.lucene.search.IndexSearcher pageIndexSearcher
               
    (package private)  org.apache.lucene.queryParser.QueryParser pageQueryParser
               
    (package private)  org.apache.lucene.queryParser.QueryParser queryParser
               
    (package private)  org.apache.lucene.search.highlight.Scorer scorer
               
     
    Constructor Summary
    DocumentIndexSearcher(LuceneIndexDescriptor docIdxDesc, LuceneIndexDescriptor pageIdxDesc)
              ctor
     
    Method Summary
     void close()
               
    private  java.lang.String getBestHighlight(java.lang.String queryStr, java.lang.String uuidStr)
               
     void intitialize()
              intializes the Reader and Searcher
     DeguHits search(java.lang.String queryString, int begin, int end)
              performs search on the document index
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    logger

    static org.jboss.logging.Logger logger

    MAX_BYTES_TO_ANALYZE

    static final int MAX_BYTES_TO_ANALYZE
    See Also:
    Constant Field Values

    MAX_BEST_FRAGMENTS

    static final int MAX_BEST_FRAGMENTS
    See Also:
    Constant Field Values

    MAX_HITS

    static final int MAX_HITS
    See Also:
    Constant Field Values

    FRAGMENT_SIZE

    static final int FRAGMENT_SIZE
    See Also:
    Constant Field Values

    docIdxDesc

    LuceneIndexDescriptor docIdxDesc

    pageIdxDesc

    LuceneIndexDescriptor pageIdxDesc

    indexReader

    org.apache.lucene.index.IndexReader indexReader

    indexSearcher

    org.apache.lucene.search.IndexSearcher indexSearcher

    pageIndexReader

    org.apache.lucene.index.IndexReader pageIndexReader

    pageIndexSearcher

    org.apache.lucene.search.IndexSearcher pageIndexSearcher

    analyzer

    org.apache.lucene.analysis.Analyzer analyzer

    queryParser

    org.apache.lucene.queryParser.QueryParser queryParser

    pageQueryParser

    org.apache.lucene.queryParser.QueryParser pageQueryParser

    scorer

    org.apache.lucene.search.highlight.Scorer scorer

    formatter

    org.apache.lucene.search.highlight.Formatter formatter

    fragmenter

    org.apache.lucene.search.highlight.SimpleFragmenter fragmenter

    high

    org.apache.lucene.search.highlight.Highlighter high
    Constructor Detail

    DocumentIndexSearcher

    public DocumentIndexSearcher(LuceneIndexDescriptor docIdxDesc,
                                 LuceneIndexDescriptor pageIdxDesc)
    ctor

    Parameters:
    docIdxDesc - information like index path, used analyzer etc.
    Method Detail

    intitialize

    public void intitialize()
                     throws java.io.IOException
    intializes the Reader and Searcher

    Throws:
    java.io.IOException

    search

    public DeguHits search(java.lang.String queryString,
                           int begin,
                           int end)
                    throws org.apache.lucene.queryParser.ParseException,
                           java.io.IOException
    performs search on the document index

    Parameters:
    queryString - a query
    Returns:
    DeguHits
    Throws:
    org.apache.lucene.queryParser.ParseException
    java.io.IOException

    getBestHighlight

    private java.lang.String getBestHighlight(java.lang.String queryStr,
                                              java.lang.String uuidStr)
                                       throws org.apache.lucene.queryParser.ParseException,
                                              java.io.IOException
    Throws:
    org.apache.lucene.queryParser.ParseException
    java.io.IOException

    close

    public void close()
               throws java.io.IOException
    Throws:
    java.io.IOException