Class LuceneUtil


  • public class LuceneUtil
    extends java.lang.Object
    Author:
    Narcis Marcu (narcism@users.sourceforge.net)
    • Constructor Detail

      • LuceneUtil

        public LuceneUtil​(JasperReportsContext jasperReportsContext,
                          boolean isCaseSensitive,
                          boolean isWholeWordsOnly,
                          boolean removeAccents)
    • Method Detail

      • createLuceneDirectory

        protected org.apache.lucene.store.Directory createLuceneDirectory​(JasperPrint jasperPrint)
                                                                   throws java.io.IOException,
                                                                          JRException
        Throws:
        java.io.IOException
        JRException
      • indexPage

        protected void indexPage​(JRPrintPage page,
                                 int pageNo)
                          throws java.io.IOException
        Throws:
        java.io.IOException
      • indexElements

        protected void indexElements​(int pageNo,
                                     java.util.List<JRPrintElement> elements)
                              throws java.io.IOException
        Throws:
        java.io.IOException
      • addContentField

        protected void addContentField​(int pageNo,
                                       JRPrintText element)
                                throws java.io.IOException
        Throws:
        java.io.IOException
      • getConfiguredAnalyzer

        protected org.apache.lucene.analysis.Analyzer getConfiguredAnalyzer()
      • buildQuery

        protected org.apache.lucene.search.spans.SpanQuery buildQuery​(java.util.List<java.lang.String> queryTerms)
      • getQueryTerms

        protected java.util.List<java.lang.String> getQueryTerms​(java.lang.String queryString)
                                                          throws java.io.IOException
        Throws:
        java.io.IOException
      • displayTokens

        protected java.lang.String displayTokens​(java.lang.String text,
                                                 java.lang.String elementId)
                                          throws java.io.IOException
        Throws:
        java.io.IOException
      • getHitTerms

        protected void getHitTerms​(org.apache.lucene.search.Query query,
                                   org.apache.lucene.search.IndexSearcher searcher,
                                   int docId,
                                   java.util.Map<java.lang.Integer,​java.util.List<org.apache.lucene.index.Term>> hitTerms)
                            throws java.io.IOException
        Throws:
        java.io.IOException