public class SearchHandle extends BaseHandle<InputStream,OperationNotSupported> implements SearchReadHandle, SearchResults
The precise nature of the results returned depends on the query options used for the search and on the configuration of this handle.
Snippets, in particular, are returned in various ways. In the default case, snippets are
returned as Java objects. For custom or raw snippets, DOM documents are returned. The
forceDOM flag can be set to cause the handle to always return DOM documents,
even in the default case.
| Modifier and Type | Class and Description |
|---|---|
class |
SearchHandle.Report
Represents a report message.
|
class |
SearchHandle.Warning
Represents a warning.
|
UNKNOWN_LENGTH| Constructor and Description |
|---|
SearchHandle() |
| Modifier and Type | Method and Description |
|---|---|
String[] |
getFacetNames()
Returns a list of the facet names returned in this search.
|
FacetResult |
getFacetResult(String name)
Returns the named facet results.
|
FacetResult[] |
getFacetResults()
Returns an array of facet results for this search.
|
MatchDocumentSummary[] |
getMatchResults()
Returns an array of summaries for the matched documents.
|
SearchMetrics |
getMetrics()
Returns the metrics associated with this search.
|
Document |
getPlan()
Returns the query plan associated with this search.
|
QueryDefinition |
getQueryCriteria()
Returns the query definition used for the search represented by this handle.
|
SearchHandle.Report[] |
getReports()
Returns an array of any reports associated with this search.
|
long |
getTotalResults()
Returns the total number of results in this search.
|
SearchHandle.Warning[] |
getWarnings()
Returns an array of any warnings associated with this search.
|
void |
setForceDOM(boolean forceDOM)
Sets the force DOM flag.
|
void |
setFormat(Format format)
Sets the format associated with this handle.
|
void |
setQueryCriteria(QueryDefinition querydef)
Sets the query definition used in the search.
|
SearchHandle |
withFormat(Format format)
Fluent setter for the format associated with this handle.
|
getByteLength, getFormat, getMimetype, setByteLength, setMimetypepublic void setFormat(Format format)
setFormat in interface ContentDescriptorsetFormat in class BaseHandle<InputStream,OperationNotSupported>format - The format, which must be Format.XML or an exception will be raised.public SearchHandle withFormat(Format format)
format - The format, which must be Format.XML or an exception will be raised.public void setForceDOM(boolean forceDOM)
true, snippets will always be returned
as DOM documents, even if the snippet format could be represented using Java
objects.forceDOM - The flag setting.public void setQueryCriteria(QueryDefinition querydef)
Calling this method always deletes any cached search results.
querydef - The new QueryDefinitionpublic QueryDefinition getQueryCriteria()
getQueryCriteria in interface SearchResultspublic long getTotalResults()
getTotalResults in interface SearchResultspublic SearchMetrics getMetrics()
getMetrics in interface SearchResultspublic MatchDocumentSummary[] getMatchResults()
getMatchResults in interface SearchResultspublic FacetResult[] getFacetResults()
getFacetResults in interface SearchResultspublic FacetResult getFacetResult(String name)
getFacetResult in interface SearchResultsname - The name of the facet.public String[] getFacetNames()
getFacetNames in interface SearchResultspublic Document getPlan()
Query plans are highly variable and are always returned as a DOM Document.
getPlan in interface SearchResultspublic SearchHandle.Warning[] getWarnings()
getWarnings in interface SearchResultspublic SearchHandle.Report[] getReports()
getReports in interface SearchResultsCopyright © 2013-2014 MarkLogic Corporation.