All Implemented Interfaces:
ContentDescriptor ,
AbstractReadHandle ,
SearchReadHandle ,
SearchResults
A SearchHandle represents a set of search
results returned by the server.
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.
Nested Class Summary
Nested Classes
static
class
Represents a report message.
static
class
Field Summary
Constructor Summary
Constructors
Method Summary
All Methods Instance Methods Concrete Methods
Returns the named constraint used in the search
(if requested).
Returns an iterator over the constraints used in
the search (if requested).
Returns the array of constraint names used in
the search (if requested).
Returns a list of the facet names returned in
this search.
Returns the named facet results.
Returns an array of facet results for this
search.
Returns an array of summaries for the matched
documents.
Returns the metrics associated with this
search.
int
Returns the page length for this search.
Returns the query plan associated with this
search.
Returns the plan for the search (if
requested).
Returns the cts:query used in the search (if
requested).
Returns the query definition used for the search
represented by this handle.
Returns an array of any reports associated with
this search.
Identifies whether results have default, raw
document, customer, or no snippets.
long
Returns the start page for this search.
Returns the list of string queries, if specified
by the query options.
long
Returns the total number of results in this
search.
Returns an array of any warnings associated with
this search.
protected void
void
Sets the format associated with this
handle.
final void
Makes the handle registry for this database
client available to this SearchHandle during processing of the
search response.
void
Sets the query definition used in the
search.
Fluent setter for the format associated with
this handle.
Methods inherited from
class com.marklogic.client.impl.HandleImplementation
getPointInTimeQueryTimestamp, isResendable, sendContent,
setPointInTimeQueryTimestamp, setResendable,
setResponseServerTimestamp
Methods
inherited from class java.lang.Object
clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait
Constructor Details
SearchHandle
public SearchHandle ()
Method Details
setFormat
public void setFormat (Format format)
Sets the format associated with this handle.
This handle only supports XML.
Specified by:
setFormat in interface ContentDescriptor
Overrides:
setFormat in
class BaseHandle <InputStream ,OperationNotSupported >
Parameters:
format - The format, which must be Format.XML or
an exception will be raised.
withFormat
Fluent setter for the format associated with
this handle. This handle only supports XML.
Parameters:
format - The format, which must be Format.XML or
an exception will be raised.
Returns:
The SearchHandle instance on which this method was called.
receiveAs
Overrides:
receiveAs in
class com.marklogic.client.impl.HandleImplementation<InputStream ,OperationNotSupported >
receiveContent
Overrides:
receiveContent in
class com.marklogic.client.impl.HandleImplementation<InputStream ,OperationNotSupported >
setQueryCriteria
Sets the query definition used in the search.
Calling this method always deletes any cached search
results.
Parameters:
querydef - The new QueryDefinition
getQueryCriteria
Returns the query definition used for the search
represented by this handle.
Specified by:
getQueryCriteria in
interface SearchResults
Returns:
The query definition.
setHandleRegistry
Makes the handle registry for this database
client available to this SearchHandle during processing of the
search response.
Parameters:
registry - the registry of IO representation
classes for this database client
getTotalResults
public long getTotalResults ()
Returns the total number of results in this
search.
Specified by:
getTotalResults in
interface SearchResults
Returns:
The number of results.
getStart
public long getStart ()
Returns the start page for this search.
Specified by:
getStart in
interface SearchResults
Returns:
The offset to the first result.
getPageLength
public int getPageLength ()
Returns the page length for this search.
Specified by:
getPageLength in
interface SearchResults
Returns:
The number of results in a page.
getSnippetTransformType
public String getSnippetTransformType ()
Identifies whether results have default, raw
document, customer, or no snippets.
Specified by:
getSnippetTransformType in
interface SearchResults
Returns:
The type of snippets provided by results.
getStringQueries
public String [] getStringQueries ()
Returns the list of string queries, if specified
by the query options.
Specified by:
getStringQueries in
interface SearchResults
Returns:
The string queries.
getQuery
Returns the cts:query used in the search (if
requested).
Specified by:
getQuery in
interface SearchResults
Type Parameters:
T - the type of XMLReadHandle to return
Parameters:
handle - An XML handle for reading the query.
Returns:
The handle on the query.
getMetrics
Returns the metrics associated with this
search.
Specified by:
getMetrics in
interface SearchResults
Returns:
The metrics.
getMatchResults
Returns an array of summaries for the matched
documents.
Specified by:
getMatchResults in
interface SearchResults
Returns:
The summary array.
getFacetNames
public String [] getFacetNames ()
Returns a list of the facet names returned in
this search.
Specified by:
getFacetNames in
interface SearchResults
Returns:
The array of names.
getFacetResult
Returns the named facet results.
Specified by:
getFacetResult in
interface SearchResults
Parameters:
name - The name of the facet.
Returns:
Returns the results for the named facet or null if no such
named facet exists.
getFacetResults
Returns an array of facet results for this
search.
Specified by:
getFacetResults in
interface SearchResults
Returns:
The facets array.
getConstraintNames
public String [] getConstraintNames ()
Returns the array of constraint names used in
the search (if requested).
Specified by:
getConstraintNames in
interface SearchResults
Returns:
The constraint names.
getConstraint
Returns the named constraint used in the search
(if requested).
Specified by:
getConstraint in
interface SearchResults
Type Parameters:
T - the type of XMLReadHandle to return
Parameters:
name - The constraint name.
handle - An XML handle for reading the
constraint.
Returns:
The handle on the constraint.
getConstraintIterator
Returns an iterator over the constraints used in
the search (if requested).
Specified by:
getConstraintIterator in
interface SearchResults
Type Parameters:
T - the type of XMLReadHandle's to return in the
Iterator
Parameters:
handle - An XML handle for reading the
constraints.
Returns:
An iterator that populates the handle with each
constraint.
getPlan
Returns the query plan associated with this
search.
Query plans are highly variable.
Specified by:
getPlan in
interface SearchResults
Returns:
the plan as a DOM Document
getPlan
Returns the plan for the search (if
requested).
Specified by:
getPlan in
interface SearchResults
Type Parameters:
T - the type of XMLReadHandle to return
Parameters:
handle - An XML handle for reading the plan.
Returns:
The handle on the plan.
getWarnings
Returns an array of any warnings associated with
this search.
Specified by:
getWarnings in
interface SearchResults
Returns:
The warnings array.
getReports
Returns an array of any reports associated with
this search.
Specified by:
getReports in
interface SearchResults
Returns:
The reports array.
Copyright (c) 2010-2025 Progress
Software Corporation and/or its subsidiaries or affiliates. All
Rights Reserved.