public interface QueryManager
Modifier and Type | Interface | Description |
---|---|---|
static class |
QueryManager.QueryView |
The view produced by a query.
|
Modifier and Type | Field | Description |
---|---|---|
static long |
DEFAULT_PAGE_LENGTH |
The default maximum number of documents in a
page of search results.
|
static long |
START |
The offset of the first result in the default
page.
|
Modifier and Type | Method | Description |
---|---|---|
<T extends StructureReadHandle> |
convert(RawQueryByExampleDefinition query,
T convertedHandle) |
Sends a query by example to the server to
convert into a combined query that expresses the criteria as a
structured search.
|
void |
delete(DeleteQueryDefinition querydef) |
Deletes documents based on the query
criteria.
|
void |
delete(DeleteQueryDefinition querydef,
Transaction transaction) |
Deletes documents based on the query criteria as
part of the specified transaction.
|
MatchDocumentSummary |
findOne(QueryDefinition querydef) |
The findOne method is a convenience.
|
MatchDocumentSummary |
findOne(QueryDefinition querydef,
Transaction transaction) |
The findOne method is a convenience.
|
long |
getPageLength() |
Returns the maximum number of documents that can
appear in any page of query results.
|
QueryManager.QueryView |
getView() |
Returns the type of view results produced by
queries.
|
DeleteQueryDefinition |
newDeleteDefinition() |
Creates a query definition for deleting
documents.
|
RawCombinedQueryDefinition |
newRawCombinedQueryDefinition(StructureWriteHandle handle) |
Defines a combined query from a JSON or XML
representation.
|
RawCombinedQueryDefinition |
newRawCombinedQueryDefinition(StructureWriteHandle handle,
java.lang.String optionsName) |
Defines a combined query from a JSON or XML
representation.
|
RawCombinedQueryDefinition |
newRawCombinedQueryDefinitionAs(Format format,
java.lang.Object rawQuery) |
Defines a combined query from a JSON or XML
representation provided as an object of an IO class.
|
RawCombinedQueryDefinition |
newRawCombinedQueryDefinitionAs(Format format,
java.lang.Object rawQuery,
java.lang.String optionsName) |
Defines a combined query from a JSON or XML
representation provided as an object of an IO class.
|
RawCtsQueryDefinition |
newRawCtsQueryDefinition(CtsQueryWriteHandle handle) |
Defines a serialized cts query from a JSON or
XML representation.
|
RawCtsQueryDefinition |
newRawCtsQueryDefinition(CtsQueryWriteHandle handle,
java.lang.String optionsName) |
Defines a serialized cts query from a JSON or
XML representation.
|
RawCtsQueryDefinition |
newRawCtsQueryDefinitionAs(Format format,
java.lang.Object rawQuery) |
Defines a serialized cts query from a JSON or
XML representation provided as an object of an IO class.
|
RawCtsQueryDefinition |
newRawCtsQueryDefinitionAs(Format format,
java.lang.Object rawQuery,
java.lang.String optionsName) |
Defines a serialized cts query from a JSON or
XML representation provided as an object of an IO class.
|
RawQueryByExampleDefinition |
newRawQueryByExampleDefinition(StructureWriteHandle handle) |
Defines a simple query by example from a JSON or
XML representation.
|
RawQueryByExampleDefinition |
newRawQueryByExampleDefinition(StructureWriteHandle handle,
java.lang.String optionsName) |
Defines a simple query by example from a JSON or
XML representation.
|
RawQueryByExampleDefinition |
newRawQueryByExampleDefinitionAs(Format format,
java.lang.Object rawQuery) |
Defines a simple query by example from a JSON or
XML representation provided as an object of an IO class.
|
RawQueryByExampleDefinition |
newRawQueryByExampleDefinitionAs(Format format,
java.lang.Object rawQuery,
java.lang.String optionsName) |
Defines a simple query by example from a JSON or
XML representation provided as an object of an IO class.
|
RawStructuredQueryDefinition |
newRawStructuredQueryDefinition(StructureWriteHandle handle) |
Defines a structured query from a JSON or XML
representation.
|
RawStructuredQueryDefinition |
newRawStructuredQueryDefinition(StructureWriteHandle handle,
java.lang.String optionsName) |
Defines a structured query from a JSON or XML
representation.
|
RawStructuredQueryDefinition |
newRawStructuredQueryDefinitionAs(Format format,
java.lang.Object rawQuery) |
Defines a structured query from a JSON or XML
representation provided as an object of an IO class.
|
RawStructuredQueryDefinition |
newRawStructuredQueryDefinitionAs(Format format,
java.lang.Object rawQuery,
java.lang.String optionsName) |
Defines a structured query from a JSON or XML
representation provided as an object of an IO class.
|
StringQueryDefinition |
newStringDefinition() |
Creates a query definition based on a string and
the default query options.
|
StringQueryDefinition |
newStringDefinition(java.lang.String optionsName) |
Creates a query definition based on a string and
on named query options saved previously.
|
StructuredQueryBuilder |
newStructuredQueryBuilder() |
Creates a query definition based on a structure
that identifies clauses and conjunctions and the default query
options.
|
StructuredQueryBuilder |
newStructuredQueryBuilder(java.lang.String optionsName) |
Creates a query definition based on a structure
and on named query options saved previously.
|
SuggestDefinition |
newSuggestDefinition() |
Creates a suggestion definition based on a
single string for completion, using the default options node.
|
SuggestDefinition |
newSuggestDefinition(java.lang.String optionsName) |
Creates a suggestion definition based on a query
options name.
|
SuggestDefinition |
newSuggestDefinition(java.lang.String suggestString,
java.lang.String optionsName) |
Creates a suggestion definition based on a
single string for completion, using the default options node.
|
ValuesDefinition |
newValuesDefinition(java.lang.String name) |
Creates a query definition for retrieving values
based on a named constraint on an index and the default query
options.
|
ValuesDefinition |
newValuesDefinition(java.lang.String name,
java.lang.String optionsName) |
Creates a query definition for retrieving values
based on a named constraint and on named query options saved
previously.
|
ValuesListDefinition |
newValuesListDefinition() |
Creates a query definition for retrieving the
list of available named lexicon configurations from the default
query options.
|
ValuesListDefinition |
newValuesListDefinition(java.lang.String optionsName) |
Creates a query definition for retrieving the
list of available named lexicon configurations from the named query
options.
|
<T extends QueryOptionsListReadHandle> |
optionsList(T listHandle) |
Retrieves the list of available named query
options.
|
<T extends QueryOptionsListReadHandle> |
optionsList(T valueHandle,
Transaction transaction) |
Retrieves the list of available named query
options.
|
<T extends SearchReadHandle> |
search(QueryDefinition querydef,
T searchHandle) |
Searches documents based on query criteria and,
potentially, previously saved query options.
|
<T extends SearchReadHandle> |
search(QueryDefinition querydef,
T searchHandle, long start) |
Searches documents based on query criteria and,
potentially, previously saved query options starting with the
specified page listing document results.
|
<T extends SearchReadHandle> |
search(QueryDefinition querydef,
T searchHandle, long start, Transaction transaction) |
Searches documents based on query criteria and,
potentially, previously saved query options starting with the
specified page listing document results.
|
<T extends SearchReadHandle> |
search(QueryDefinition querydef,
T searchHandle, long start, Transaction transaction,
java.lang.String forestName) |
Searches documents based on query criteria and,
potentially, previously saved query options starting with the
specified page listing document results.
|
<T extends SearchReadHandle> |
search(QueryDefinition querydef,
T searchHandle, long start,
java.lang.String forestName) |
Searches documents based on query criteria and,
potentially, previously saved query options starting with the
specified page listing document results.
|
<T extends SearchReadHandle> |
search(QueryDefinition querydef,
T searchHandle, Transaction transaction) |
Searches documents based on query criteria and,
potentially, previously saved query options.
|
<T extends SearchReadHandle> |
search(QueryDefinition querydef,
T searchHandle, Transaction transaction,
java.lang.String forestName) |
Searches documents based on query criteria and,
potentially, previously saved query options.
|
<T extends SearchReadHandle> |
search(QueryDefinition querydef,
T searchHandle, java.lang.String forestName) |
Searches documents based on query criteria and,
potentially, previously saved query options.
|
void |
setPageLength(long length) |
Specifies the maximum number of documents that
can appear in any page of the query results, overriding any maximum
specified in the query options.
|
void |
setView(QueryManager.QueryView view) |
Specifies the type of view results produced by
queries.
|
void |
startLogging(RequestLogger logger) |
Starts debugging client requests.
|
void |
stopLogging() |
Stops debugging client requests.
|
java.lang.String[] |
suggest(SuggestDefinition suggestionDef) |
Queries the REST server for suggested string
completions based on values in the SuggestionDefinition.
|
<T extends TuplesReadHandle> |
tuples(ValuesDefinition valdef,
T tupleHandle) |
Retrieves combinations of values for the same
document from indexes based on query criteria and, potentially,
previously saved query options.
|
<T extends TuplesReadHandle> |
tuples(ValuesDefinition valdef,
T tupleHandle, long start) |
Retrieves combinations of values for the same
document from indexes based on query criteria and, potentially,
previously saved query options.
|
<T extends TuplesReadHandle> |
tuples(ValuesDefinition valdef,
T tupleHandle, long start, Transaction transaction) |
Retrieves combinations of values for the same
document from indexes based on query criteria and, potentially,
previously saved query options.
|
<T extends TuplesReadHandle> |
tuples(ValuesDefinition valdef,
T tupleHandle, Transaction transaction) |
Retrieves combinations of values for the same
document from indexes based on query criteria and, potentially,
previously saved query options.
|
<T extends StructureReadHandle> |
validate(RawQueryByExampleDefinition query,
T reportHandle) |
Checks a query by example for mistakes in
expressing the criteria.
|
<T extends ValuesReadHandle> |
values(ValuesDefinition valdef,
T valueHandle) |
Retrieves values from indexes based on query
criteria and, potentially, previously saved query options.
|
<T extends ValuesReadHandle> |
values(ValuesDefinition valdef,
T valueHandle, long start) |
Retrieves values from indexes based on query
criteria and, potentially, previously saved query options.
|
<T extends ValuesReadHandle> |
values(ValuesDefinition valdef,
T valueHandle, long start, Transaction transaction) |
Retrieves values from indexes based on query
criteria and, potentially, previously saved query options.
|
<T extends ValuesReadHandle> |
values(ValuesDefinition valdef,
T valueHandle, Transaction transaction) |
Retrieves values from indexes based on query
criteria and, potentially, previously saved query options.
|
<T extends ValuesListReadHandle> |
valuesList(ValuesListDefinition valdef,
T valueHandle) |
Retrieves the list of available named lexicon
configurations from the values list definition and, potentially,
previously saved query options.
|
<T extends ValuesListReadHandle> |
valuesList(ValuesListDefinition valdef,
T valueHandle, Transaction transaction) |
Retrieves the list of available named lexicon
configurations from the values list definition and, potentially,
previously saved query options.
|
static final long DEFAULT_PAGE_LENGTH
static final long START
long getPageLength()
void setPageLength(long length)
length
- the maximum number of resultsQueryManager.QueryView getView()
void setView(QueryManager.QueryView view)
view
- the view type for the queriesStringQueryDefinition newStringDefinition()
StringQueryDefinition newStringDefinition(java.lang.String optionsName)
optionsName
- the name of the query optionsSuggestDefinition newSuggestDefinition()
SuggestDefinition newSuggestDefinition(java.lang.String optionsName)
optionsName
- the name of the query optionsSuggestDefinition newSuggestDefinition(java.lang.String suggestString, java.lang.String optionsName)
suggestString
- A string as input for completion
suggestions.optionsName
- the name of the query optionsStructuredQueryBuilder newStructuredQueryBuilder()
StructuredQueryBuilder newStructuredQueryBuilder(java.lang.String optionsName)
optionsName
- the name of the query optionsDeleteQueryDefinition newDeleteDefinition()
ValuesDefinition newValuesDefinition(java.lang.String name)
name
- the index constraintValuesDefinition newValuesDefinition(java.lang.String name, java.lang.String optionsName)
name
- the index constraintoptionsName
- the name of the query optionsValuesListDefinition newValuesListDefinition()
ValuesListDefinition newValuesListDefinition(java.lang.String optionsName)
optionsName
- the name of the query options<T extends SearchReadHandle> T search(QueryDefinition querydef, T searchHandle)
T
- the type of SearchReadHandle to returnquerydef
- the definition of query criteria and
query optionssearchHandle
- a handle for reading the results
from the search<T extends SearchReadHandle> T search(QueryDefinition querydef, T searchHandle, java.lang.String forestName)
T
- the type of SearchReadHandle to returnquerydef
- the definition of query criteria and
query optionssearchHandle
- a handle for reading the results
from the searchforestName
- a forest to limit this search<T extends SearchReadHandle> T search(QueryDefinition querydef, T searchHandle, long start)
T
- the type of SearchReadHandle to returnquerydef
- the definition of query criteria and
query optionssearchHandle
- a handle for reading the results
from the searchstart
- the offset of the first document in the
page (where 1 is the first result)<T extends SearchReadHandle> T search(QueryDefinition querydef, T searchHandle, long start, java.lang.String forestName)
T
- the type of SearchReadHandle to returnquerydef
- the definition of query criteria and
query optionssearchHandle
- a handle for reading the results
from the searchstart
- the offset of the first document in the
page (where 1 is the first result)forestName
- a forest to limit this search<T extends SearchReadHandle> T search(QueryDefinition querydef, T searchHandle, Transaction transaction)
T
- the type of SearchReadHandle to returnquerydef
- the definition of query criteria and
query optionssearchHandle
- a handle for reading the results
from the searchtransaction
- a open transaction for matching
documents<T extends SearchReadHandle> T search(QueryDefinition querydef, T searchHandle, Transaction transaction, java.lang.String forestName)
T
- the type of SearchReadHandle to returnquerydef
- the definition of query criteria and
query optionssearchHandle
- a handle for reading the results
from the searchtransaction
- a open transaction for matching
documentsforestName
- a forest to limit this search<T extends SearchReadHandle> T search(QueryDefinition querydef, T searchHandle, long start, Transaction transaction)
T
- the type of SearchReadHandle to returnquerydef
- the definition of query criteria and
query optionssearchHandle
- a handle for reading the results
from the searchstart
- the offset of the first document in the
page (where 1 is the first result)transaction
- a open transaction for matching
documents<T extends SearchReadHandle> T search(QueryDefinition querydef, T searchHandle, long start, Transaction transaction, java.lang.String forestName)
T
- the type of SearchReadHandle to returnquerydef
- the definition of query criteria and
query optionssearchHandle
- a handle for reading the results
from the searchstart
- the offset of the first document in the
page (where 1 is the first result)transaction
- a open transaction for matching
documentsforestName
- a forest to limit this searchjava.lang.String[] suggest(SuggestDefinition suggestionDef)
suggestionDef
- the partial string to complete and
suggest query optionsvoid delete(DeleteQueryDefinition querydef)
querydef
- the definition of query criteriavoid delete(DeleteQueryDefinition querydef, Transaction transaction)
querydef
- the definition of query criteriatransaction
- a open transaction for the delete
operation<T extends ValuesReadHandle> T values(ValuesDefinition valdef, T valueHandle)
T
- the type of ValuesReadHandle to returnvaldef
- the definition of query criteria and
query optionsvalueHandle
- a handle for reading the values for
the matched documents<T extends ValuesReadHandle> T values(ValuesDefinition valdef, T valueHandle, long start)
T
- the type of ValuesReadHandle to returnvaldef
- the definition of query criteria and
query optionsvalueHandle
- a handle for reading the values for
the matched documentsstart
- the offset of the first returned result
(where 1 is the first value)<T extends ValuesReadHandle> T values(ValuesDefinition valdef, T valueHandle, Transaction transaction)
T
- the type of ValuesReadHandle to returnvaldef
- the definition of query criteria and
query optionsvalueHandle
- a handle for reading the values for
the matched documentstransaction
- a open transaction for matching
documents<T extends ValuesReadHandle> T values(ValuesDefinition valdef, T valueHandle, long start, Transaction transaction)
T
- the type of ValuesReadHandle to returnvaldef
- the definition of query criteria and
query optionsvalueHandle
- a handle for reading the values for
the matched documentsstart
- the offset of the first returned result
(where 1 is the first value)transaction
- a open transaction for matching
documents<T extends TuplesReadHandle> T tuples(ValuesDefinition valdef, T tupleHandle)
T
- the type of TuplesReadHandle to returnvaldef
- the definition of query criteria and
query optionstupleHandle
- a handle for reading the tuples for
the matched documents<T extends TuplesReadHandle> T tuples(ValuesDefinition valdef, T tupleHandle, long start)
T
- the type of TuplesReadHandle to returnvaldef
- the definition of query criteria and
query optionstupleHandle
- a handle for reading the tuples for
the matched documentsstart
- the offset of the first returned result
(where 1 is the first tuple)<T extends TuplesReadHandle> T tuples(ValuesDefinition valdef, T tupleHandle, Transaction transaction)
T
- the type of TuplesReadHandle to returnvaldef
- the definition of query criteria and
query optionstupleHandle
- a handle for reading the tuples for
the matched documentstransaction
- a open transaction for matching
documents<T extends TuplesReadHandle> T tuples(ValuesDefinition valdef, T tupleHandle, long start, Transaction transaction)
T
- the type of TuplesReadHandle to returnvaldef
- the definition of query criteria and
query optionstupleHandle
- a handle for reading the tuples for
the matched documentsstart
- the offset of the first returned result
(where 1 is the first tuple)transaction
- a open transaction for matching
documents<T extends ValuesListReadHandle> T valuesList(ValuesListDefinition valdef, T valueHandle)
T
- the type of ValuesListReadHandle to
returnvaldef
- the definition of the query criteria and
optionsvalueHandle
- a handle for reading the list of
names lexicon configurations<T extends ValuesListReadHandle> T valuesList(ValuesListDefinition valdef, T valueHandle, Transaction transaction)
T
- the type of ValuesListReadHandle to
returnvaldef
- the definition of the query criteria and
optionsvalueHandle
- a handle for reading the list of
names lexicon configurationstransaction
- a open transaction for matching
documents<T extends QueryOptionsListReadHandle> T optionsList(T listHandle)
T
- the type of QueryOptionsListReadHandle to
returnlistHandle
- a handle for reading the list of name
options<T extends QueryOptionsListReadHandle> T optionsList(T valueHandle, Transaction transaction)
T
- the type of QueryOptionsListReadHandle to
returnvalueHandle
- a handle for reading the list of
name optionstransaction
- a open transaction for matching
documentsMatchDocumentSummary findOne(QueryDefinition querydef)
querydef
- the definition of query criteria and
query optionsMatchDocumentSummary findOne(QueryDefinition querydef, Transaction transaction)
querydef
- the definition of query criteria and
query optionstransaction
- a open transaction for matching
documents<T extends StructureReadHandle> T convert(RawQueryByExampleDefinition query, T convertedHandle)
T
- the type of StructureReadHandle to returnquery
- the query by exampleconvertedHandle
- the container to use for the new
converted query<T extends StructureReadHandle> T validate(RawQueryByExampleDefinition query, T reportHandle)
T
- the type of StructureReadHandle to returnquery
- the query by examplereportHandle
- a handle for reading the validation
reportvoid startLogging(RequestLogger logger)
logger
- the logger that receives debugging
outputvoid stopLogging()
RawCombinedQueryDefinition newRawCombinedQueryDefinitionAs(Format format, java.lang.Object rawQuery)
ContentHandle
are registered. Learn more
about shortcut methodsformat
- whether the format of the representation
is JSON or XMLrawQuery
- an IO representation of the JSON or XML
combined queryRawCombinedQueryDefinition newRawCombinedQueryDefinitionAs(Format format, java.lang.Object rawQuery, java.lang.String optionsName)
ContentHandle
are registered. Learn more
about shortcut methodsformat
- whether the format of the representation
is JSON or XMLrawQuery
- an IO representation of the JSON or XML
combined queryoptionsName
- the name of a persisted query
options configurationRawCombinedQueryDefinition newRawCombinedQueryDefinition(StructureWriteHandle handle)
handle
- a handle for a JSON or XML combined
queryRawCombinedQueryDefinition newRawCombinedQueryDefinition(StructureWriteHandle handle, java.lang.String optionsName)
handle
- a handle for a JSON or XML combined
queryoptionsName
- the name of a persisted query
options configurationRawStructuredQueryDefinition newRawStructuredQueryDefinitionAs(Format format, java.lang.Object rawQuery)
ContentHandle
are registered. Learn more
about shortcut methodsformat
- whether the format of the representation
is JSON or XMLrawQuery
- an IO representation of the JSON or XML
structured queryRawStructuredQueryDefinition newRawStructuredQueryDefinitionAs(Format format, java.lang.Object rawQuery, java.lang.String optionsName)
ContentHandle
are registered. Learn more
about shortcut methodsformat
- whether the format of the representation
is JSON or XMLrawQuery
- an IO representation of the JSON or XML
structured queryoptionsName
- the name of a persisted query
options configurationRawStructuredQueryDefinition newRawStructuredQueryDefinition(StructureWriteHandle handle)
handle
- a handle for a JSON or XML structured
queryRawStructuredQueryDefinition newRawStructuredQueryDefinition(StructureWriteHandle handle, java.lang.String optionsName)
handle
- a handle for a JSON or XML structured
queryoptionsName
- the name of a persisted query
options configurationRawCtsQueryDefinition newRawCtsQueryDefinitionAs(Format format, java.lang.Object rawQuery)
ContentHandle
are registered. Learn more
about shortcut methodsformat
- whether the format of the representation
is JSON or XMLrawQuery
- an IO representation of the JSON or XML
serialized cts queryRawCtsQueryDefinition newRawCtsQueryDefinitionAs(Format format, java.lang.Object rawQuery, java.lang.String optionsName)
ContentHandle
are registered. Learn more
about shortcut methodsformat
- whether the format of the representation
is JSON or XMLrawQuery
- an IO representation of the JSON or XML
serialized cts queryoptionsName
- the name of a persisted query
options configurationRawCtsQueryDefinition newRawCtsQueryDefinition(CtsQueryWriteHandle handle)
handle
- a handle for a JSON or XML serialized cts
queryRawCtsQueryDefinition newRawCtsQueryDefinition(CtsQueryWriteHandle handle, java.lang.String optionsName)
handle
- a handle for a JSON or XML serialized cts
queryoptionsName
- the name of a persisted query
options configurationRawQueryByExampleDefinition newRawQueryByExampleDefinitionAs(Format format, java.lang.Object rawQuery)
ContentHandle
are registered. Learn more
about shortcut methodsformat
- whether the format of the representation
is JSON or XMLrawQuery
- an IO representation of the query by
exampleRawQueryByExampleDefinition newRawQueryByExampleDefinitionAs(Format format, java.lang.Object rawQuery, java.lang.String optionsName)
ContentHandle
are registered. Learn more
about shortcut methodsformat
- whether the format of the representation
is JSON or XMLrawQuery
- an IO representation of the query by
exampleoptionsName
- the name of a persisted query
options configurationRawQueryByExampleDefinition newRawQueryByExampleDefinition(StructureWriteHandle handle)
handle
- a handle for a JSON or XML query by
example.RawQueryByExampleDefinition newRawQueryByExampleDefinition(StructureWriteHandle handle, java.lang.String optionsName)
handle
- a handle for a JSON or XML query by
example.optionsName
- The name of a persisted query
options configurationCopyright © 2013-2019 MarkLogic Corporation.