Class LuceneUtil
- java.lang.Object
-
- net.sf.jasperreports.interactivity.search.LuceneUtil
-
public class LuceneUtil extends Object
- Author:
- Narcis Marcu (narcism@users.sourceforge.net)
-
-
Constructor Summary
Constructors Constructor Description LuceneUtil(JasperReportsContext jasperReportsContext, boolean isCaseSensitive, boolean isWholeWordsOnly, boolean removeAccents)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addContentField(int pageNo, JRPrintText element)
protected org.apache.lucene.search.spans.SpanQuery
buildQuery(List<String> queryTerms)
protected org.apache.lucene.store.Directory
createLuceneDirectory(JasperPrint jasperPrint)
protected String
displayTokens(String text, String elementId)
protected org.apache.lucene.analysis.Analyzer
getConfiguredAnalyzer()
protected void
getHitTerms(org.apache.lucene.search.Query query, org.apache.lucene.search.IndexSearcher searcher, int docId, Map<Integer,List<org.apache.lucene.index.Term>> hitTerms)
protected List<String>
getQueryTerms(String queryString)
SpansInfo
getSpansInfo(JasperPrint jasperPrint, String queryString)
protected JRStyledText
getStyledText(JRPrintText textElement)
protected void
indexElements(int pageNo, List<JRPrintElement> elements)
protected void
indexPage(JRPrintPage page, int pageNo)
-
-
-
Constructor Detail
-
LuceneUtil
public LuceneUtil(JasperReportsContext jasperReportsContext, boolean isCaseSensitive, boolean isWholeWordsOnly, boolean removeAccents)
-
-
Method Detail
-
getSpansInfo
public SpansInfo getSpansInfo(JasperPrint jasperPrint, String queryString) throws IOException, JRException
- Throws:
IOException
JRException
-
createLuceneDirectory
protected org.apache.lucene.store.Directory createLuceneDirectory(JasperPrint jasperPrint) throws IOException, JRException
- Throws:
IOException
JRException
-
indexPage
protected void indexPage(JRPrintPage page, int pageNo) throws IOException
- Throws:
IOException
-
indexElements
protected void indexElements(int pageNo, List<JRPrintElement> elements) throws IOException
- Throws:
IOException
-
addContentField
protected void addContentField(int pageNo, JRPrintText element) throws IOException
- Throws:
IOException
-
getConfiguredAnalyzer
protected org.apache.lucene.analysis.Analyzer getConfiguredAnalyzer()
-
getStyledText
protected JRStyledText getStyledText(JRPrintText textElement)
-
getQueryTerms
protected List<String> getQueryTerms(String queryString) throws IOException
- Throws:
IOException
-
displayTokens
protected String displayTokens(String text, String elementId) throws IOException
- Throws:
IOException
-
getHitTerms
protected void getHitTerms(org.apache.lucene.search.Query query, org.apache.lucene.search.IndexSearcher searcher, int docId, Map<Integer,List<org.apache.lucene.index.Term>> hitTerms) throws IOException
- Throws:
IOException
-
-