org.gcube.indexmanagement.lucenewrapper
Class LuceneSearchWorker
java.lang.Object
java.lang.Thread
org.gcube.indexmanagement.lucenewrapper.LuceneSearchWorker
- All Implemented Interfaces:
- Runnable
public class LuceneSearchWorker
- extends Thread
A worker thread to take care of the ResultSet feeding after a query
|
Constructor Summary |
LuceneSearchWorker(gr.uoa.di.madgik.grs.writer.RecordWriter<gr.uoa.di.madgik.grs.record.GenericRecord> rsWriter,
org.apache.lucene.index.IndexReader reader,
QueryTerm[] terms,
org.apache.lucene.search.Hits queryHits,
int numberOfHits,
FullTextIndexType idxType,
boolean isComplete,
ArrayList<String> presentable,
LinkedHashMap<String,String> projections,
QuerySnippetTermsPair querySnippetTermsPair,
RRadaptor adaptor)
The constructor |
| Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
LuceneSearchWorker
public LuceneSearchWorker(gr.uoa.di.madgik.grs.writer.RecordWriter<gr.uoa.di.madgik.grs.record.GenericRecord> rsWriter,
org.apache.lucene.index.IndexReader reader,
QueryTerm[] terms,
org.apache.lucene.search.Hits queryHits,
int numberOfHits,
FullTextIndexType idxType,
boolean isComplete,
ArrayList<String> presentable,
LinkedHashMap<String,String> projections,
QuerySnippetTermsPair querySnippetTermsPair,
RRadaptor adaptor)
- The constructor
- Parameters:
rsWriter - -
The ResultSet writer to be used by the new LuceneSearchWorker
thread.reader - -
An IndexReader to be used in order to find Query statistics.terms - -
QueryTerms from the Lucene query.queryHits - -
The hits resulting from the Lucene querynumberOfHits - -
The number of hits from the Lucene queryidxType - -
The IndexType of the queried Index.presentable - querySnippetTermsPair -
setSnippetSize
public void setSnippetSize(Integer snippetSize)
setMaximumSnippetsCount
public void setMaximumSnippetsCount(Integer maximumSnippetsCount)
run
public void run()
-
- Specified by:
run in interface Runnable- Overrides:
run in class Thread
getFreq
public int getFreq(org.apache.lucene.index.Term t,
int docID)
throws IOException
- A method used to count the occurrence frequency of a Term in a Document.
- Parameters:
t - -
The Term of which to count the occurrences.docID - -
The Document in which to count the Term frequency.
- Returns:
- The requested Term frequency.
- Throws:
IOException - An error reading from the Lucene Index.
getFreq
public int getFreq(Enumeration fields,
String termString,
int docID)
throws IOException
- A method used to the Term frequency of the term termString for multiple
fields in the document(docID).
- Parameters:
fields - -
The fields to include in term fequency count.termString - -
The term text of which to count the occurrences.docID - -
The document in which to count the term frequency.
- Returns:
- The requested Term frequency.
- Throws:
IOException - An error reading from the Lucene Index.
Copyright © 2013. All Rights Reserved.