|
DLESE Tools v1.6.0 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.dlese.dpc.index.reader.DocReader
public abstract class DocReader
An abstract bean for accessing the data stored in the Lucene Document
s
that are returned from a search. All concrete DocReader classes must implement a default no-argument
constructor so that they may be created automatically by the factory ResultDoc.getDocReader()
. In addition, the index writer corresponding to the concrete
reader must implement the DocWriter.getReaderClass()
method.
SimpleLuceneIndex
,
ResultDoc
Field Summary | |
---|---|
protected ResultDocConfig |
conf
The index that was searched over. |
protected org.apache.lucene.document.Document |
doc
The Lucene Document that is being read. |
protected ResultDoc |
resultDoc
|
protected float |
score
The Lucene score assigned to the Document, or -1 if none available. |
Constructor Summary | |
---|---|
protected |
DocReader()
Constructor that initializes an empty DocReader. |
protected |
DocReader(org.apache.lucene.document.Document myDoc)
Constructor that may be used programatically to wrap a reader around a Lucene Document that was created by a DocWriter . |
Method Summary | |
---|---|
void |
doInit(org.apache.lucene.document.Document myDoc,
ResultDoc resultDoc,
float myScore,
ResultDocConfig myConf)
Called by ResultDoc at search time to initialize a new instance of a
DocReader. |
Object |
getAttribute(String key)
Gets an attribute that has been previously set using SimpleLuceneIndex.setAttribute(String,Object) . |
DocumentMap |
getDocMap()
Gets a DocumentMap of all field/values contained in the Lucene Document . |
org.apache.lucene.document.Document |
getDocument()
Gets the Lucene Document associated with this DocReader. |
SimpleLuceneIndex |
getIndex()
Gets the index that was searched over to produce the resulting hit. |
LazyDocumentMap |
getLazyDocMap()
Gets a LazyDocumentMap of all field/values contained in the Lucene Document . |
String |
getQuery()
Gets the query that was used in the search. |
abstract String |
getReaderType()
Gets a String describing the reader type. |
RepositoryManager |
getRepositoryManager()
Gets the RepositoryManager associated with this DocReader or null if not available. |
String |
getScore()
Gets the Lucene score for the Document , or -1 if none available. |
abstract void |
init()
An init method that may be used by concrete classes to initialize variables and resources as needed. |
protected void |
setDoc(org.apache.lucene.document.Document myDoc)
Sets the Lucene Document that is being read by this DocReader. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected org.apache.lucene.document.Document doc
protected float score
protected ResultDocConfig conf
protected ResultDoc resultDoc
Constructor Detail |
---|
protected DocReader(org.apache.lucene.document.Document myDoc)
Document
that was created by a DocWriter
.
myDoc
- Gets the Lucene Document that is being read by this DocReader.DocWriter
protected DocReader()
Method Detail |
---|
public abstract String getReaderType()
public abstract void init()
public final void doInit(org.apache.lucene.document.Document myDoc, ResultDoc resultDoc, float myScore, ResultDocConfig myConf)
ResultDoc
at search time to initialize a new instance of a
DocReader.
myDoc
- The Lucene DocumentmyScore
- The Lucene score asigned to this hitmyConf
- The config available to the doc readerpublic DocumentMap getDocMap()
DocumentMap
of all field/values contained in the Lucene Document
. The text values in each field is stored in the Map as Strings. For
example getDocMap.get("title") returns the text that was indexed and stored under the field name "title"
for this Document.Example that uses JSTL inside a JSP page (assumes result is an instance of ResultDoc):
The title is: ${result.docMap["title"]}
DocumentMap
public LazyDocumentMap getLazyDocMap()
LazyDocumentMap
of all field/values contained in the Lucene Document
. The text values in each field is stored in the Map as Strings. For
example getDocMap.get("title") returns the text that was indexed and stored under the field name "title"
for this Document.Example that uses JSTL inside a JSP page (assumes result is an instance of ResultDoc):
The title is: ${result.docMap["title"]}
DocumentMap
protected void setDoc(org.apache.lucene.document.Document myDoc)
myDoc
- The new doc valuepublic String getScore()
Document
, or -1 if none available.
public org.apache.lucene.document.Document getDocument()
Document
associated with this DocReader.
Document
.public SimpleLuceneIndex getIndex()
public Object getAttribute(String key)
SimpleLuceneIndex.setAttribute(String,Object)
.
key
- The key for the attribute
SimpleLuceneIndex.setAttribute(String,Object)
public RepositoryManager getRepositoryManager()
public String getQuery()
|
DLESE Tools v1.6.0 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |