|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectScoreDoc
FieldDoc
DocHit
DocHitImpl
public class DocHitImpl
Represents a query hit at the document level. May contain Snippet
s
if those were requested.
Field Summary | |
---|---|
private static char |
bumpMarker
Bump marker used to denote different meta-data fields w/ same name |
private int |
chunkCount
Total number of chunks for this document |
private String |
docKey
Index key for this document |
private Explanation |
explanation
Explanation of this document's score |
private FieldSpans |
fieldSpans
Spans per field |
private long |
fileDate
Date the original source XML document was last modified |
private AttribList |
metaData
Document's meta-data fields (copied from the docInfo chunk) |
private int |
recordNum
Record number of this document within the main file |
private SnippetMaker |
snippetMaker
Used to load and format snippets |
private Snippet[] |
snippets
Array of pre-built snippets |
Fields inherited from class FieldDoc |
---|
fields |
Fields inherited from class ScoreDoc |
---|
doc, score |
Constructor Summary | |
---|---|
DocHitImpl(int docNum,
float score)
Construct a document hit. |
Method Summary | |
---|---|
Explanation |
explanation()
Retrieve an explanation of this document's score |
String |
filePath()
Retrieve the original file path as recorded in the index (if any.) |
(package private) void |
finish(SnippetMaker snippetMaker,
float docScoreNorm)
Called after all hits have been gathered to normalize the scores and associate a snippetMaker for later use. |
(package private) void |
finishWithExplain(SnippetMaker snippetMaker,
float docScoreNorm,
Weight weight,
BoostSet boostSet,
BoostSetParams boostParams)
Called after all hits have been gathered to normalize the scores and associate a snippetMaker for later use. |
private void |
load()
Read in the document info chunk and record the path, date, etc. that we find there. |
private void |
loadMetaField(String name,
String value,
Document docContents,
AttribList metaData,
boolean isTokenized)
Performs all the manipulations and marking for a meta-data field. |
AttribList |
metaData()
Retrieve a list of all meta-data name/value pairs associated with this document. |
int |
nSnippets()
Return the number of snippets available (limited by the max # specified in the original query.) |
int |
recordNum()
Retrieve the record number of this document within the main file, or zero if this is the only record. |
(package private) void |
setSpans(FieldSpans spans)
Sets the spans after they've been recorded and de-duped. |
Snippet |
snippet(int hitNum,
boolean getText)
Retrieve the specified snippet. |
Set |
textTerms()
Fetch a map that can be used to check whether a given term is present in the original query that produced this hit. |
int |
totalSnippets()
Return the total number of snippets found for this document (not the number actually returned, which is limited by the max # of snippets specified in the query.) |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private SnippetMaker snippetMaker
private FieldSpans fieldSpans
private Snippet[] snippets
private String docKey
private long fileDate
private int recordNum
private int chunkCount
private AttribList metaData
private Explanation explanation
private static final char bumpMarker
Constructor Detail |
---|
DocHitImpl(int docNum, float score)
docNum
- Lucene ID for the document info chunkscore
- Score for this hitMethod Detail |
---|
void setSpans(FieldSpans spans)
void finish(SnippetMaker snippetMaker, float docScoreNorm)
snippetMaker
- Will be used later by snippet() to actually
create the snippets.docScoreNorm
- Multiplied into the document's scorevoid finishWithExplain(SnippetMaker snippetMaker, float docScoreNorm, Weight weight, BoostSet boostSet, BoostSetParams boostParams) throws IOException
snippetMaker
- Will be used later by snippet() to actually
create the snippets.docScoreNorm
- Multiplied into the document's scoreweight
- The query weight that will be used to calculate
an explanation.boostSet
- The boost set used, or null if noneboostParams
- Other boost set parameters (e.g. exponent)
IOException
private void load()
private void loadMetaField(String name, String value, Document docContents, AttribList metaData, boolean isTokenized)
name
- Name of the fieldvalue
- Raw string value of the fielddocContents
- Where to get spans frommetaData
- Where to put the resulting dataisTokenized
- true if the field was tokenized and should be
marked.public Set textTerms()
public final String filePath()
filePath
in class DocHit
public final int recordNum()
recordNum
in class DocHit
public final AttribList metaData()
metaData
in class DocHit
public final int totalSnippets()
totalSnippets
in class DocHit
public final int nSnippets()
nSnippets
in class DocHit
public final Snippet snippet(int hitNum, boolean getText)
snippet
in class DocHit
hitNum
- 0..nSnippets()getText
- true to fetch the snippet text in context, false to
only fetch the rank, score, etc.public Explanation explanation()
explanation
in class DocHit
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |