write handle
or
read handle
implementation instead of this class to write or read
query options. For instance:
String opts = new StringBuilder()
.append("<options xmlns=\"http://marklogic.com/appservices/search\">")
.append( "<debug>true</debug>")
.append("</options>")
.toString();
optsMgr.writeOptions("debug", new StringHandle(opts));
or
String opts = "{\"options\":{\"debug\":true}}";
optsMgr.writeOptions("debug", new StringHandle(opts).withFormat(Format.JSON));
@Deprecated public final class QueryOptionsHandle extends BaseHandle<InputStream,OutputStreamSender> implements OutputStreamSender, BufferableHandle, QueryOptionsReadHandle, QueryOptionsWriteHandle, Annotatable<QueryOptionsHandle>
UNKNOWN_LENGTH
Constructor and Description |
---|
QueryOptionsHandle()
Deprecated.
Construct a new empty QueryOptionsHandle object.
|
Modifier and Type | Method and Description |
---|---|
void |
addConstraint(QueryOptions.QueryConstraint constraint)
Deprecated.
Add a constraint to the query options.
|
void |
addForest(long forest)
Deprecated.
Add a forest constraint to the operator state.
|
void |
addOperator(QueryOptions.QueryOperator operator)
Deprecated.
Add an operator to the query options.
|
void |
addSearchOption(String searchOption)
Deprecated.
Add a search option to the query options.
|
void |
addSuggestionSource(QueryOptions.QuerySuggestionSource suggestionSource)
Deprecated.
Add a suggestion source to the query options.
|
void |
addValues(QueryOptions.QueryValues values)
Deprecated.
Add a values accessor to the query options.
|
QueryOptionsHandle |
annotate(String queryAnnotation)
Deprecated.
|
void |
fromBuffer(byte[] buffer)
Deprecated.
Loads a query options node from a byte array.
|
Element |
getAdditionalQuery()
Deprecated.
Returns the additional query from a query options configuration.
|
List<QueryOptions.QueryAnnotation> |
getAnnotations()
Deprecated.
Returns a List of all the annotations in the query options.
|
int |
getConcurrencyLevel()
Deprecated.
Returns the concurrency level from the query options configuration.
|
QueryOptions.QueryConstraint |
getConstraint(String constraintName)
Deprecated.
Return the named query constraint from the query options.
|
List<QueryOptions.QueryConstraint> |
getConstraints()
Deprecated.
Returns a List of all the constraints in the query options.
|
Boolean |
getDebug()
Deprecated.
Returns the state of the Debug flag in the query options.
|
QueryOptions.QueryDefaultSuggestionSource |
getDefaultSuggestionSource()
Deprecated.
Returns the default suggestion source in the query options.
|
QueryOptions.QueryExtractMetadata |
getExtractMetadata()
Deprecated.
Returns the extract metadata setting from the options node.
|
List<Long> |
getForests()
Deprecated.
Returns a List of the forest constraints.
|
Format |
getFormat()
Deprecated.
Returns the underlying format supported by the query options handle.
|
QueryOptions.FragmentScope |
getFragmentScope()
Deprecated.
Returns the fragment scope setting from the query options.
|
QueryOptions.QueryGrammar |
getGrammar()
Deprecated.
Returns the search grammar specified in the query options.
|
QueryOptions.QueryOperator |
getOperator(String name)
Deprecated.
Returns the named query operator.
|
List<QueryOptions.QueryOperator> |
getOperators()
Deprecated.
Returns a List of the operators specified in the query options.
|
QueryOptions |
getOptions()
Deprecated.
Returns the underlying QueryOptions representation of the query options.
|
long |
getPageLength()
Deprecated.
Returns the page length specified in the query options.
|
double |
getQualityWeight()
Deprecated.
Returns the quality weight specified in the query options.
|
Boolean |
getReturnAggregates()
Deprecated.
Returns the return aggregates option from the query options.
|
Boolean |
getReturnConstraints()
Deprecated.
Returns the return constraints option from the query options.
|
Boolean |
getReturnFacets()
Deprecated.
Returns the return facets option from the query options.
|
Boolean |
getReturnFrequencies()
Deprecated.
Returns the return frequencies option from the query options.
|
Boolean |
getReturnMetrics()
Deprecated.
Returns the return metrics option from the query options.
|
Boolean |
getReturnPlan()
Deprecated.
Returns the return query plan option from the query options.
|
Boolean |
getReturnQtext()
Deprecated.
Returns the return query text option from the query options.
|
Boolean |
getReturnQuery()
Deprecated.
Returns the return query option from the query options.
|
Boolean |
getReturnResults()
Deprecated.
Returns the return results option from the query options.
|
Boolean |
getReturnSimilar()
Deprecated.
Returns the return similar option from the query options.
|
Boolean |
getReturnValues()
Deprecated.
Returns the return values option from the query options.
|
String |
getSearchableExpression()
Deprecated.
Returns the searchable expression in the query options.
|
NamespaceContext |
getSearchableExpressionNamespaceContext()
Deprecated.
Returns the namespace context associated with the searchable expression in the query options.
|
List<String> |
getSearchOptions()
Deprecated.
Returns a List of the search options in the query options.
|
List<QueryOptions.QuerySortOrder> |
getSortOrders()
Deprecated.
Returns a List of the sort orders specified in the query options.
|
List<QueryOptions.QuerySuggestionSource> |
getSuggestionSources()
Deprecated.
Returns a List of the suggestion sources in the query options.
|
QueryOptions.QueryTerm |
getTerm()
Deprecated.
Returns the term associated specified in the query options.
|
QueryOptions.QueryTransformResults |
getTransformResults()
Deprecated.
Returns the transform results setting specified in the query options.
|
List<QueryOptions.QueryTuples> |
getTuples()
Deprecated.
Returns a List of the tuples accessors in the query options.
|
QueryOptions.QueryTuples |
getTuples(String tuplesName)
Deprecated.
Returns the named tuples accessor.
|
List<QueryOptions.QueryValues> |
getValues()
Deprecated.
Returns a List of the values accessors in the query options.
|
QueryOptions.QueryValues |
getValues(String valuesName)
Deprecated.
Returns the named values accessor.
|
void |
setAdditionalQuery(Element ctsQuery)
Deprecated.
Sets the ctsQuery element in the query options.
|
void |
setConcurrencyLevel(Integer concurrencyLevel)
Deprecated.
Sets the concurrency level in the query options.
|
void |
setConstraints(List<QueryOptions.QueryConstraint> constraints)
Deprecated.
Set a List of constraints in the query options.
|
void |
setDebug(Boolean debug)
Deprecated.
Sets the debug flag in the query options.
|
void |
setDefaultSuggestionSource(QueryOptions.QueryDefaultSuggestionSource defaultSuggestionSource)
Deprecated.
Sets the default suggestion source in the query options.
|
void |
setExtractMetadata(QueryOptions.QueryExtractMetadata extractMetadata)
Deprecated.
Sets the extract metadata setting in the options node.
|
void |
setForests(List<Long> forests)
Deprecated.
Sets a List of forests constraints in the query options.
|
void |
setFormat(Format format)
Deprecated.
Set the format accepted by this handle.
|
void |
setFragmentScope(QueryOptions.FragmentScope fragmentScope)
Deprecated.
Sets the fragment scope in the query options.
|
void |
setGrammar(QueryOptions.QueryGrammar grammar)
Deprecated.
Sets the grammar in the query options.
|
void |
setOperators(List<QueryOptions.QueryOperator> operatorOptions)
Deprecated.
Sets a List of operators in the query options.
|
void |
setPageLength(Long pageLength)
Deprecated.
Sets the page length in the query options.
|
void |
setQualityWeight(Double qualityWeight)
Deprecated.
Sets the quality weight in the search options.
|
void |
setReturnAggregates(Boolean returnAggregates)
Deprecated.
Sets the return aggregates option in the query options.
|
void |
setReturnConstraints(Boolean returnConstraints)
Deprecated.
Sets the return constraints option in the query options.
|
void |
setReturnFacets(Boolean returnFacets)
Deprecated.
Sets the return facets option in the query options.
|
void |
setReturnFrequencies(Boolean returnFrequencies)
Deprecated.
Sets the return frequencies option in the query options.
|
void |
setReturnMetrics(Boolean returnMetrics)
Deprecated.
Sets the return metric option in the query options.
|
void |
setReturnPlan(Boolean returnPlan)
Deprecated.
Sets the return query plan option in the query options.
|
void |
setReturnQtext(Boolean returnQtext)
Deprecated.
Sets the return query text option in the query options.
|
void |
setReturnQuery(Boolean returnQuery)
Deprecated.
Sets the return query option in the query options.
|
void |
setReturnResults(Boolean returnResults)
Deprecated.
Sets the return results option in the query options.
|
void |
setReturnSimilar(Boolean returnSimilar)
Deprecated.
Sets the return similar option in the query options.
|
void |
setReturnValues(Boolean returnValues)
Deprecated.
Sets the return values option in the query options.
|
void |
setSearchableExpression(String searchableExpression)
Deprecated.
Sets the searchable expression in the query options.
|
void |
setSearchableExpressionNamespaceContext(EditableNamespaceContext context)
Deprecated.
Sets the namespace context to be associated with the searchable expression.
|
void |
setSearchOptions(List<String> searchOptions)
Deprecated.
Set a List of search options in the query options.
|
void |
setSortOrders(List<QueryOptions.QuerySortOrder> sortOrders)
Deprecated.
Set a List of sort orders in the query options.
|
void |
setSuggestionSources(List<QueryOptions.QuerySuggestionSource> suggestionSources)
Deprecated.
Set a List of suggestion sources in the query options.
|
void |
setTerm(QueryOptions.QueryTerm termConfig)
Deprecated.
Set the term configuration in the query options.
|
void |
setTransformResults(QueryOptions.QueryTransformResults transformResults)
Deprecated.
Set the transform results in the query options.
|
void |
setTuples(List<QueryOptions.QueryTuples> tuples)
Deprecated.
Sets a List of tuples in the query options.
|
void |
setValues(List<QueryOptions.QueryValues> values)
Deprecated.
Sets a List of values in the query options.
|
byte[] |
toBuffer()
Deprecated.
Returns the query options node in a byte array.
|
String |
toString()
Deprecated.
Returns the Query Options as an XML string.
|
QueryOptionsHandle |
withAdditionalQuery(QueryOptions.QueryAdditionalQuery additionalQuery)
Deprecated.
Sets the ctsQuery element in the query options.
|
QueryOptionsHandle |
withConfiguration(QueryOptionsConfiguration configuration)
Deprecated.
Set common configuration objects for this handle, fluently.
|
QueryOptionsHandle |
withConstraints(QueryOptions.QueryConstraint... constraints)
Deprecated.
Set a List of constraints in the query options.
|
QueryOptionsHandle |
withExtractMetadata(QueryOptions.QueryExtractMetadata extractMetadata)
Deprecated.
Sets the extract metadata setting in the options node.
|
QueryOptionsHandle |
withGrammar(QueryOptions.QueryGrammar grammar)
Deprecated.
Sets the grammar in the query options.
|
QueryOptionsHandle |
withOperators(QueryOptions.QueryOperator... queryOperator)
Deprecated.
Sets a List of operators in the query options.
|
QueryOptionsHandle |
withSearchableExpression(QueryOptions.QuerySearchableExpression searchableExpression)
Deprecated.
Sets the searchable expression in the query options.
|
QueryOptionsHandle |
withSortOrders(QueryOptions.QuerySortOrder... sortOrders)
Deprecated.
Set a List of sort orders in the query options.
|
QueryOptionsHandle |
withTerm(QueryOptions.QueryTerm term)
Deprecated.
Set the term configuration in the query options.
|
QueryOptionsHandle |
withTransformResults(QueryOptions.QueryTransformResults transformResults)
Deprecated.
Set the transform results in the query options.
|
QueryOptionsHandle |
withTuples(QueryOptions.QueryTuples... tuples)
Deprecated.
Sets a List of tuples in the query options.
|
QueryOptionsHandle |
withValues(QueryOptions.QueryValues... values)
Deprecated.
Sets a List of values in the query options.
|
void |
write(OutputStream out)
Deprecated.
Writes the query options node (as XML) to the specified output stream.
|
getByteLength, getMimetype, setByteLength, setMimetype
public QueryOptionsHandle()
public QueryOptionsHandle annotate(String queryAnnotation)
annotate
in interface Annotatable<QueryOptionsHandle>
public void addConstraint(QueryOptions.QueryConstraint constraint)
constraint
- The constraint.public void addForest(long forest)
forest
- The forest id number on the server.public void addOperator(QueryOptions.QueryOperator operator)
operator
- The operator.public void addSearchOption(String searchOption)
searchOption
- The option.public void addSuggestionSource(QueryOptions.QuerySuggestionSource suggestionSource)
suggestionSource
- The source.public void addValues(QueryOptions.QueryValues values)
values
- The values accessor.public Element getAdditionalQuery()
public int getConcurrencyLevel()
public QueryOptions.QueryConstraint getConstraint(String constraintName)
constraintName
- The name of the constraint.public List<QueryOptions.QueryConstraint> getConstraints()
public List<QueryOptions.QueryAnnotation> getAnnotations()
getAnnotations
in interface Annotatable<QueryOptionsHandle>
public Boolean getDebug()
public QueryOptions.QueryDefaultSuggestionSource getDefaultSuggestionSource()
public List<Long> getForests()
public Format getFormat()
getFormat
in interface ContentDescriptor
getFormat
in class BaseHandle<InputStream,OutputStreamSender>
public QueryOptions.FragmentScope getFragmentScope()
public QueryOptions.QueryGrammar getGrammar()
public List<QueryOptions.QueryOperator> getOperators()
public QueryOptions getOptions()
public long getPageLength()
public double getQualityWeight()
public List<QueryOptions.QueryValues> getValues()
public QueryOptions.QueryValues getValues(String valuesName)
valuesName
- The name of a values accessor.public List<QueryOptions.QueryTuples> getTuples()
public QueryOptions.QueryTuples getTuples(String tuplesName)
tuplesName
- The name of a tuples accessor.public Boolean getReturnAggregates()
public Boolean getReturnConstraints()
public Boolean getReturnFacets()
public Boolean getReturnFrequencies()
public Boolean getReturnMetrics()
public Boolean getReturnPlan()
public Boolean getReturnQtext()
public Boolean getReturnQuery()
public Boolean getReturnResults()
public Boolean getReturnSimilar()
public Boolean getReturnValues()
public NamespaceContext getSearchableExpressionNamespaceContext()
public String getSearchableExpression()
public List<String> getSearchOptions()
public List<QueryOptions.QuerySortOrder> getSortOrders()
public List<QueryOptions.QuerySuggestionSource> getSuggestionSources()
public QueryOptions.QueryTerm getTerm()
public QueryOptions.QueryTransformResults getTransformResults()
public void setAdditionalQuery(Element ctsQuery)
ctsQuery
- A DOM node representation of the cts:query.public void setConcurrencyLevel(Integer concurrencyLevel)
concurrencyLevel
- The concurrency level.public void setDebug(Boolean debug)
debug
- The flag.public void setDefaultSuggestionSource(QueryOptions.QueryDefaultSuggestionSource defaultSuggestionSource)
defaultSuggestionSource
- The default source.public void setForests(List<Long> forests)
forests
- A list of forest id numbers from the server.public void setFormat(Format format)
setFormat
in interface ContentDescriptor
setFormat
in class BaseHandle<InputStream,OutputStreamSender>
format
- The format, which must Format.XML or an exception will be raised.public void setFragmentScope(QueryOptions.FragmentScope fragmentScope)
fragmentScope
- The scope.public void setGrammar(QueryOptions.QueryGrammar grammar)
grammar
- The grammar.public QueryOptionsHandle withGrammar(QueryOptions.QueryGrammar grammar)
grammar
- The grammar.public void setOperators(List<QueryOptions.QueryOperator> operatorOptions)
operatorOptions
- The list of operators.public void setPageLength(Long pageLength)
pageLength
- The page length.public QueryOptionsHandle withOperators(QueryOptions.QueryOperator... queryOperator)
queryOperator
- The list of operators.public void setTuples(List<QueryOptions.QueryTuples> tuples)
tuples
- The list of tuples.public QueryOptionsHandle withTuples(QueryOptions.QueryTuples... tuples)
tuples
- The list of tuples.public void setValues(List<QueryOptions.QueryValues> values)
values
- The list of values.public QueryOptionsHandle withValues(QueryOptions.QueryValues... values)
values
- The list of values.public void setQualityWeight(Double qualityWeight)
qualityWeight
- The weight.public void setReturnAggregates(Boolean returnAggregates)
returnAggregates
- The return aggregates option.public void setReturnConstraints(Boolean returnConstraints)
returnConstraints
- The return constraints option.public void setReturnFacets(Boolean returnFacets)
returnFacets
- The return facets option.public void setReturnFrequencies(Boolean returnFrequencies)
returnFrequencies
- The return frequencies option.public void setReturnMetrics(Boolean returnMetrics)
returnMetrics
- The return metrics option.public void setReturnQuery(Boolean returnQuery)
returnQuery
- The return query option.public void setReturnPlan(Boolean returnPlan)
returnPlan
- The return plan option.public void setReturnQtext(Boolean returnQtext)
returnQtext
- The return query text option.public void setReturnResults(Boolean returnResults)
returnResults
- The return results option.public void setReturnSimilar(Boolean returnSimilar)
returnSimilar
- The return similar option.public void setReturnValues(Boolean returnValues)
returnValues
- The return values option.public void setSearchableExpression(String searchableExpression)
searchableExpression
- The expression.public void setSearchableExpressionNamespaceContext(EditableNamespaceContext context)
context
- The namespace context.public void setSearchOptions(List<String> searchOptions)
searchOptions
- The list of options.public void setSortOrders(List<QueryOptions.QuerySortOrder> sortOrders)
sortOrders
- The list of sort orders.public void setSuggestionSources(List<QueryOptions.QuerySuggestionSource> suggestionSources)
suggestionSources
- The list of sources.public QueryOptionsHandle withAdditionalQuery(QueryOptions.QueryAdditionalQuery additionalQuery)
additionalQuery
- An object representation of the cts:query. Build with QueryOptionsBuilder.additionalQuerypublic QueryOptionsHandle withSearchableExpression(QueryOptions.QuerySearchableExpression searchableExpression)
searchableExpression
- The searchableExpression, in an object together with namespace bindings.public QueryOptionsHandle withSortOrders(QueryOptions.QuerySortOrder... sortOrders)
sortOrders
- The list of sort orders.public void setTerm(QueryOptions.QueryTerm termConfig)
termConfig
- The term configuration.public void setTransformResults(QueryOptions.QueryTransformResults transformResults)
transformResults
- The transform results.public QueryOptionsHandle withTerm(QueryOptions.QueryTerm term)
term
- The term configuration.public QueryOptionsHandle withTransformResults(QueryOptions.QueryTransformResults transformResults)
transformResults
- The transform results.public void write(OutputStream out) throws IOException
write
in interface OutputStreamSender
out
- the output stream receiving the node.IOException
- if there is an I/O error writing to that stream.public void fromBuffer(byte[] buffer)
fromBuffer
in interface BufferableHandle
buffer
- the byte arraypublic byte[] toBuffer()
toBuffer
in interface BufferableHandle
public String toString()
public QueryOptions.QueryOperator getOperator(String name)
name
- The name of the operator.public QueryOptions.QueryExtractMetadata getExtractMetadata()
public void setExtractMetadata(QueryOptions.QueryExtractMetadata extractMetadata)
extractMetadata
- The extract metadata setting.public QueryOptionsHandle withExtractMetadata(QueryOptions.QueryExtractMetadata extractMetadata)
extractMetadata
- The extract metadata setting.public void setConstraints(List<QueryOptions.QueryConstraint> constraints)
constraints
- The list of constraints.public QueryOptionsHandle withConstraints(QueryOptions.QueryConstraint... constraints)
constraints
- The list of constraints.public QueryOptionsHandle withConfiguration(QueryOptionsConfiguration configuration)
configuration
- The configuration object containing common settings.Copyright © 2013-2016 MarkLogic Corporation.