public interface QueryManager
Modifier and Type | Interface and Description |
---|---|
static class |
QueryManager.QueryView
The view produced by a query.
|
Modifier and Type | Field and 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 and Description |
---|---|
<T extends StructureReadHandle> |
convert(RawQueryByExampleDefinition query,
T convertedHandle)
Converts a query by example 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.
|
ElementLocator |
newElementLocator(QName element)
Creates a locator for a key-value query based on an element name,
which may have namespace.
|
ElementLocator |
newElementLocator(QName element,
QName attribute)
Creates a locator for a key-value query based on an element name
and attribute name, either or both of which may have a namespace.
|
KeyLocator |
newKeyLocator(String key)
Creates a locator for a key-value query based on a JSON key.
|
KeyValueQueryDefinition |
newKeyValueDefinition()
Creates a query definition based on a locator such as a JSON key,
element name, or element and attribute name and the default query
options.
|
KeyValueQueryDefinition |
newKeyValueDefinition(String optionsName)
Creates a query definition based on a locator and on named
query options saved previously.
|
RawCombinedQueryDefinition |
newRawCombinedQueryDefinition(StructureWriteHandle handle)
Defines a combined query from a JSON or XML representation.
|
RawCombinedQueryDefinition |
newRawCombinedQueryDefinition(StructureWriteHandle handle,
String optionsName)
Defines a combined query from a JSON or XML representation.
|
RawCombinedQueryDefinition |
newRawCombinedQueryDefinitionAs(Format format,
Object rawQuery)
Defines a combined query from a JSON or XML representation provided as an object of an IO class.
|
RawCombinedQueryDefinition |
newRawCombinedQueryDefinitionAs(Format format,
Object rawQuery,
String optionsName)
Defines a combined 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,
String optionsName)
Defines a simple query by example from a JSON or XML representation.
|
RawQueryByExampleDefinition |
newRawQueryByExampleDefinitionAs(Format format,
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,
Object rawQuery,
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,
String optionsName)
Defines a structured query from a JSON or XML representation.
|
RawStructuredQueryDefinition |
newRawStructuredQueryDefinitionAs(Format format,
Object rawQuery)
Defines a structured query from a JSON or XML representation provided as an object of an IO class.
|
RawStructuredQueryDefinition |
newRawStructuredQueryDefinitionAs(Format format,
Object rawQuery,
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(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(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(String optionsName)
Creates a suggestion definition based on a query options name.
|
SuggestDefinition |
newSuggestDefinition(String suggestString,
String optionsName)
Creates a suggestion definition based on a single string for completion,
using the default options node.
|
ValuesDefinition |
newValuesDefinition(String name)
Creates a query definition for retrieving values based on
a named constraint on an index and the default query options.
|
ValuesDefinition |
newValuesDefinition(String name,
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(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,
Transaction transaction)
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.
|
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(String optionsName)
optionsName
- the name of the query optionsKeyValueQueryDefinition newKeyValueDefinition()
KeyValueQueryDefinition newKeyValueDefinition(String optionsName)
optionsName
- the name of the query optionsSuggestDefinition newSuggestDefinition()
SuggestDefinition newSuggestDefinition(String optionsName)
optionsName
- the name of the query optionsSuggestDefinition newSuggestDefinition(String suggestString, String optionsName)
suggestString
- A string as input for completion suggestions.optionsName
- the name of the query optionsStructuredQueryBuilder newStructuredQueryBuilder()
StructuredQueryBuilder newStructuredQueryBuilder(String optionsName)
optionsName
- the name of the query optionsDeleteQueryDefinition newDeleteDefinition()
ValuesDefinition newValuesDefinition(String name)
name
- the index constraintValuesDefinition newValuesDefinition(String name, String optionsName)
name
- the index constraintoptionsName
- the name of the query optionsValuesListDefinition newValuesListDefinition()
ValuesListDefinition newValuesListDefinition(String optionsName)
optionsName
- the name of the query optionsElementLocator newElementLocator(QName element)
element
- the element nameElementLocator newElementLocator(QName element, QName attribute)
element
- the element nameattribute
- the attribute nameKeyLocator newKeyLocator(String key)
key
- the JSON key<T extends SearchReadHandle> T search(QueryDefinition querydef, T searchHandle)
querydef
- 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, long start)
querydef
- 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, Transaction transaction)
querydef
- 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, long start, Transaction transaction)
querydef
- 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 documentsString[] suggest(SuggestDefinition suggestionDef)
void 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)
valdef
- 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)
valdef
- 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)
valdef
- 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)
valdef
- 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)
valdef
- 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)
valdef
- 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)
valdef
- 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)
valdef
- 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)
valdef
- 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)
valdef
- 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)
listHandle
- a handle for reading the list of name options<T extends QueryOptionsListReadHandle> T optionsList(T valueHandle, Transaction transaction)
valueHandle
- 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)
query
- the query by exampleconvertedHandle
- <T extends StructureReadHandle> T validate(RawQueryByExampleDefinition query, T reportHandle)
query
- 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, Object rawQuery)
format
- whether the format of the representation is JSON or XMLrawQuery
- an IO representation of the JSON or XML combined queryRawCombinedQueryDefinition newRawCombinedQueryDefinitionAs(Format format, Object rawQuery, String optionsName)
format
- 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, String optionsName)
handle
- a handle for a JSON or XML combined queryoptionsName
- the name of a persisted query options configurationRawStructuredQueryDefinition newRawStructuredQueryDefinitionAs(Format format, Object rawQuery)
format
- whether the format of the representation is JSON or XMLrawQuery
- an IO representation of the JSON or XML structured queryRawStructuredQueryDefinition newRawStructuredQueryDefinitionAs(Format format, Object rawQuery, String optionsName)
format
- 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, String optionsName)
handle
- a handle for a JSON or XML structured queryoptionsName
- the name of a persisted query options configurationRawQueryByExampleDefinition newRawQueryByExampleDefinitionAs(Format format, Object rawQuery)
format
- whether the format of the representation is JSON or XMLrawQuery
- an IO representation of the query by exampleRawQueryByExampleDefinition newRawQueryByExampleDefinitionAs(Format format, Object rawQuery, String optionsName)
format
- 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, String optionsName)
handle
- a handle for a JSON or XML query by example.optionsName
- The name of a persisted query options configurationCopyright © 2013-2015 MarkLogic Corporation.