public class QueryResult
extends Object
Modifier and Type | Field and Description |
---|---|
QueryContext |
context
Context of the query (including stop word list, and maps for
plurals and accents).
|
private DecimalFormat |
decFormat
Formatter for non-normalized scores
|
DocHit[] |
docHits
One hit per document
|
int |
endDoc
Oridinal rank of the last document hit returned, plus 1
|
ResultFacet[] |
facets
Faceted results grouped by field value (if specified in query)
|
boolean |
scoresNormalized
Whether document scores were normalized so that highest ranking doc
has score 100.
|
int |
startDoc
Ordinal rank of the first document hit returned (0-based)
|
SpellingSuggestion[] |
suggestions
Spelling suggestions for query terms (if spellcheck specified)
|
Set |
textTerms
A set that can be used to check whether a given term is present
in the original query that produced this hit.
|
int |
totalDocs
Total number of documents matched by the query (possibly many more
than are returned in this particular request.)
|
Constructor and Description |
---|
QueryResult() |
Modifier and Type | Method and Description |
---|---|
Source |
hitsToSource(String mainTagName,
String extraStuff)
Makes an XML document out of the list of document hits, and returns a
Source object that represents it.
|
String |
hitsToString(String mainTagName,
String extraStuff)
Makes an XML document out of the list of document hits, and returns a
String object that represents it.
|
private void |
structureDocHits(DocHit[] docHits,
int startDoc,
StringBuffer buf)
Does the work of turning DocHits into XML.
|
private void |
structureExplanation(Explanation exp,
StringBuffer buf)
Does the work of turning a score explanation into XML.
|
private void |
structureGroup(ResultGroup group,
StringBuffer buf)
Does the work of turning faceted groups into XML.
|
private void |
structureSuggestions(StringBuffer buf)
Does the work of translating spelling suggestions into XML.
|
public QueryContext context
public Set textTerms
public int totalDocs
public int startDoc
public int endDoc
public boolean scoresNormalized
public DocHit[] docHits
public ResultFacet[] facets
public SpellingSuggestion[] suggestions
private DecimalFormat decFormat
public Source hitsToSource(String mainTagName, String extraStuff)
mainTagName
- Name of the top-level tag to generate (e.g.
"crossQueryResult", etc.)extraStuff
- Additional XML to insert into the query
result document. Typically includes <parameters>
block and <query> block.public String hitsToString(String mainTagName, String extraStuff)
mainTagName
- Name of the top-level tag to generate (e.g.
"crossQueryResult", etc.)extraStuff
- Additional XML to insert into the query
result document. Typically includes <parameters>
block and <query> block.private void structureGroup(ResultGroup group, StringBuffer buf)
group
- The group to work onbuf
- Buffer to add XML toprivate void structureDocHits(DocHit[] docHits, int startDoc, StringBuffer buf)
docHits
- Array of DocHits to structurebuf
- Buffer to add the XML toprivate void structureExplanation(Explanation exp, StringBuffer buf)
private void structureSuggestions(StringBuffer buf)