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 class QueryOptionsBuilder extends Object
Constructor and Description |
---|
QueryOptionsBuilder()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
QueryOptions.QueryAdditionalQuery |
additionalQuery(String ctsQuery)
Deprecated.
incorporates a cts:query expression into the search.
|
QueryOptions.Aggregate |
aggregate(String aggregateFunctionName)
Deprecated.
Builds an aggregate specification for use in configuring tuples or
values.
|
QueryOptions.Aggregate |
aggregate(String aggregateFunctionName,
String aggregatePlugin)
Deprecated.
Builds an aggregate specification for use in configuring tuples or
values.
|
GeospatialSpec |
attributePairGeospatialIndex(QName parent,
QName latitudeAttribute,
QName longitudeAttribute)
Deprecated.
Builds a geospatial index from data where latitude and longitude are
stored as XML attributes.
|
QueryOptions.AttributeValue |
attributeValue(QName elemName,
QName attrName)
Deprecated.
Builds a specification to retrieve values from an attribute into the
extract-metadata section of search results.
|
QueryOptions.QueryRange.Bucket |
bucket(String name,
String label,
String ge,
String lt)
Deprecated.
Builds a new bucket for use in a
QueryOptions.QueryRange configuration |
List<Buckets> |
buckets(Buckets... buckets)
Deprecated.
Builds a list of buckets from definitions built by either bucket or computedBucket
|
QueryOptions.QueryCollection |
collection(String prefix)
Deprecated.
Builds a QueryCollection object to use the Collection URI lexicon as source of
constraint values.
|
QueryOptions.QueryCollection |
collection(String prefix,
QueryOptions.Facets isFaceted,
String... options)
Deprecated.
Builds a QueryCollection object to use the Collection URI lexicon as source of
constraint values.
|
QueryOptions.QueryRange.ComputedBucket |
computedBucket(String name,
String label,
String ge,
String lt,
QueryOptions.QueryRange.ComputedBucket.AnchorValue anchor)
Deprecated.
Builds a new bucket for use in a
QueryOptions.QueryRange |
QueryOptionsConfiguration |
configure()
Deprecated.
Create a new QueryOptionsConfiguration object, which can be used to
fluently set various configuration options.
|
QueryOptions.QueryConstraint |
constraint(String name,
ConstraintSource source)
Deprecated.
Builds a constraint object with the supplied name and source.
|
QueryOptions.ConstraintValue |
constraintValue(String constraintName)
Deprecated.
Constructs an argument to be used for building ExtractMetadata
configuration.
|
ConstraintSource |
customFacet(QueryOptions.XQueryExtension parse,
QueryOptions.XQueryExtension start,
QueryOptions.XQueryExtension finish,
String... facetOptions)
Deprecated.
Defines an XQuery customization for specifying constraint faceting
behavior.
|
ConstraintSource |
customParse(QueryOptions.XQueryExtension parse,
String... termOptions)
Deprecated.
Defines an XQuery customization for specifying constraint values.
|
RangeSpec |
elementAttributeRangeIndex(QName element,
QName attribute,
RangeIndexType type)
Deprecated.
Builds an element-attribute range index specification.
|
TermSpec |
elementAttributeTermIndex(QName element,
QName attribute)
Deprecated.
Builds an element-attribute index specification.
|
GeospatialSpec |
elementChildGeospatialIndex(QName parent,
QName geospatialElement)
Deprecated.
Builds a geospatial index from data where latitude and longitude
are encoded together in one element, and are children of
a specified element.
|
GeospatialSpec |
elementGeospatialIndex(QName geospatialElement)
Deprecated.
Builds a geospatial index from data where latitude and longitude are
stored together in one XML element.
|
GeospatialSpec |
elementPairGeospatialIndex(QName parent,
QName latitudeElement,
QName longitudeElement)
Deprecated.
Builds a geospatial index from data where latitude and longitude are
stored as text in XML elements.
|
QueryOptions.QueryElementQuery |
elementQuery(QName qname)
Deprecated.
Builds a QueryElementQuery object for use in constraining
searches to a particular element.
|
RangeSpec |
elementRangeIndex(QName element,
RangeIndexType type)
Deprecated.
Builds an element range index specification.
|
TermSpec |
elementTermIndex(QName element)
Deprecated.
Builds an element index specification.
|
QueryOptions.ElementValue |
elementValue(QName elemName)
Deprecated.
Builds a specification to retrieve values from an element.
|
QueryOptions.QueryTransformResults |
emptySnippets()
Deprecated.
Configures search results to return no result node.
|
QueryOptions.XQueryExtension |
extension(String apply,
String ns,
String at)
Deprecated.
Builds a reference to an XQuery extension point.
|
QueryOptions.QueryExtractMetadata |
extractMetadata(MetadataExtract... extractions)
Deprecated.
Builds a configuration for extracting metadata from search results.
|
QueryOptions.Field |
field(String name)
Deprecated.
Builds a field specification with the given name.
|
RangeSpec |
fieldRangeIndex(String fieldName,
RangeIndexType type)
Deprecated.
Builds a field range index specification.
|
TermSpec |
fieldTermIndex(String fieldName)
Deprecated.
Builds a field index specification.
|
ConstraintSource |
geospatial(GeospatialSpec index,
HeatmapAndOptions heatmap,
String... geoOptions)
Deprecated.
Builds a geospatial specification for a two-dimensional constraint.
|
ConstraintSource |
geospatial(GeospatialSpec index,
String... geoOptions)
Deprecated.
Builds a geospatial specification for a two-dimensional constraint.
|
QueryOptions.QueryGrammar |
grammar(List<QueryOptions.QueryGrammar.QueryStarter> starters,
List<QueryOptions.QueryGrammar.QueryJoiner> joiners,
String quotation,
Element implicit)
Deprecated.
Builds the definition of a query grammar.
|
HeatmapAndOptions |
heatmap(double south,
double west,
double north,
double east,
int latitudeDivs,
int longitudeDivs,
String... options)
Deprecated.
Builds a heatmap specification.
|
QueryOptions.QueryGrammar.QueryJoiner |
joiner(String joinerText,
int strength,
QueryOptions.QueryGrammar.QueryJoiner.JoinerApply apply)
Deprecated.
Builds a QueryJoiner for use in a Search API
QueryOptions.QueryGrammar . |
QueryOptions.QueryGrammar.QueryJoiner |
joiner(String joinerText,
int strength,
QueryOptions.QueryGrammar.QueryJoiner.JoinerApply apply,
QueryOptions.QueryGrammar.QueryJoiner.Comparator comparator,
QueryOptions.QueryGrammar.Tokenize tokenize)
Deprecated.
Builds a QueryJoiner for use in a Search API
QueryOptions.QueryGrammar |
QueryOptions.QueryGrammar.QueryJoiner |
joiner(String joinerText,
int strength,
QueryOptions.QueryGrammar.QueryJoiner.JoinerApply apply,
String element,
QueryOptions.QueryGrammar.Tokenize token)
Deprecated.
Builds a QueryJoiner for use in a Search API
QueryOptions.QueryGrammar |
QueryOptions.QueryGrammar.QueryJoiner |
joiner(String joinerText,
int strength,
QueryOptions.QueryGrammar.QueryJoiner.JoinerApply apply,
String element,
QueryOptions.QueryGrammar.Tokenize tokenize,
Integer consume)
Deprecated.
Builds a more complex QueryJoiner for use in a Search API
QueryOptions.QueryGrammar
This method includes 'consume' which
specifies how far to extend the scope of a cts:near-query query. |
List<QueryOptions.QueryGrammar.QueryJoiner> |
joiners(QueryOptions.QueryGrammar.QueryJoiner... joiners)
Deprecated.
Builds a list of
QueryOptions.QueryGrammar.QueryJoiner
for use in constructing QueryOptions.QueryGrammar
instances. |
RangeSpec |
jsonRangeIndex(String jsonKey,
RangeIndexType type)
Deprecated.
Builds a jsonKey range index specification.
|
TermSpec |
jsonTermIndex(String jsonKey)
Deprecated.
Builds a JSON index specification.
|
QueryOptions.JsonKey |
jsonValue(String keyName)
Deprecated.
Builds a specification to retrieve values from a json key into the
extract-metadata section of search results.
|
QueryOptions.QueryTransformResults |
metadataSnippetTransform(QName... preferredElements)
Deprecated.
Configures search results to include data from properties fragments.
|
QueryOptions.ExpressionNamespaceBindings |
namespaces(QueryOptions.ExpressionNamespaceBinding... namespaces)
Deprecated.
Builds a list of namespace/prefix bindings, as part of a
QueryOptions.PathIndex
or QueryOptions.QuerySearchableExpression configuration. |
QueryOptions.ExpressionNamespaceBinding |
ns(String prefix,
String namespaceURI)
Deprecated.
Builds an object that binds a prefix to a namespace uri.
|
QueryOptions.QueryOperator |
operator(String name,
QueryOptions.QueryState... states)
Deprecated.
Builds an operator for use in a QueryOptions configuration.
|
RangeSpec |
pathIndex(String xPath,
QueryOptions.ExpressionNamespaceBinding... bindings)
Deprecated.
Builds a new PathIndex object.
|
RangeSpec |
pathIndex(String xPath,
QueryOptions.ExpressionNamespaceBindings bindings,
RangeIndexType type)
Deprecated.
Builds a new PathIndex object.
|
ConstraintSource |
properties()
Deprecated.
Builds a new QueryProperties, which restricts a named constraint to data
stored in the properties fragment.
|
QueryOptions.QueryRange |
range(RangeSpec indexSpec)
Deprecated.
Builds a range index specification for use in a constraint, value, tuple or term configuration.
|
QueryOptions.QueryRange |
range(RangeSpec indexSpec,
QueryOptions.Facets faceted,
QueryOptions.FragmentScope scope,
List<Buckets> buckets,
String... facetOptions)
Deprecated.
Builds a range index specification for use in a constraint, values, tuples or term configuration.
|
RangeIndexType |
rangeType(String type)
Deprecated.
Builds a range index type for types other than xs:string.
|
QueryOptions.QueryTransformResults |
rawResults()
Deprecated.
Configures search results to return raw XML documents
|
QueryOptions.QuerySearchableExpression |
searchableExpression(String searchableExpression,
QueryOptions.ExpressionNamespaceBinding... bindings)
Deprecated.
Defines an XPath expression to be used as the context for all searches.
|
QueryOptions.QueryTransformResults |
snippetTransform(Integer perMatchTokens,
Integer maxMatches,
Integer maxSnippetChars,
QName... preferredElements)
Deprecated.
Configures the way default snippets look in search results.
|
QueryOptions.QuerySortOrder |
sortByScore(QueryOptions.QuerySortOrder.Direction direction)
Deprecated.
Builds a QuerySortOrder for sorting by search relevance score, and a
Direction.
|
QueryOptions.QuerySortOrder |
sortOrder(RangeSpec indexSpec,
QueryOptions.QuerySortOrder.Direction direction)
Deprecated.
Builds a QuerySortOrder configuration from a RangeSpec, and a Direction.
|
QueryOptions.QuerySortOrder |
sortOrder(TermSpec indexSpec)
Deprecated.
Builds a QuerySortOrder configuration from a TermSpec.
|
List<QueryOptions.QuerySortOrder> |
sortOrders(QueryOptions.QuerySortOrder... sortOrders)
Deprecated.
Builds a list of sort orders.
|
QueryOptions.QueryGrammar.QueryStarter |
starterGrouping(String text,
int strength,
String delimiter)
Deprecated.
Builds a starter used for grouping terms.
|
QueryOptions.QueryGrammar.QueryStarter |
starterPrefix(String text,
int strength,
String element)
Deprecated.
Builds a starter used for prefixing terms.
|
List<QueryOptions.QueryGrammar.QueryStarter> |
starters(QueryOptions.QueryGrammar.QueryStarter... starters)
Deprecated.
Builds a list of starters for use in grammars.
|
QueryOptions.QueryState |
state(String stateName)
Deprecated.
Builds an empty QueryState object with the provided name.
|
RangeIndexType |
stringRangeType(String collation)
Deprecated.
Builds a range index type for strings.
|
QueryOptions.QueryTerm |
term(QueryOptions.QueryTerm.TermApply empty,
String defaultSourceName,
String... termOptions)
Deprecated.
Builds a term configuration with an source for default searching.
|
QueryOptions.QueryTerm |
term(QueryOptions.QueryTerm.TermApply empty,
TermSource defaultSource,
String... termOptions)
Deprecated.
Builds a term configuration with an source for default searching.
|
QueryOptions.QueryTerm |
term(QueryOptions.XQueryExtension extension)
Deprecated.
Builds a term configuration with an extension.
|
QueryOptions.QueryTerm |
term(String... termOptions)
Deprecated.
Builds a term option that consists solely of valid term option strings.
|
QueryOptions.QueryTransformResults |
transformResults(QueryOptions.XQueryExtension extension)
Deprecated.
Transform results with a custom XQuery extension
|
QueryOptions.QueryTuples |
tuples(String name,
List<TupleSource> sources,
QueryOptions.Aggregate aggregate,
String... valuesOptions)
Deprecated.
Builds a QueryTuples object.
|
QueryOptions.QueryTuples |
tuples(String name,
List<TupleSource> sources,
String... valuesOptions)
Deprecated.
Builds a QueryTuples object.
|
List<TupleSource> |
tupleSources(TupleSource... tupleSources)
Deprecated.
Builds a List of
TupleSource s from 0..N Tuple Sources. |
QueryUri |
uri()
Deprecated.
Builds a reference to the document uri lexicon, for use in values and
tuples specification.
|
ConstraintSource |
value(TermSpec indexSpec)
Deprecated.
Builds a value index specification for use in a constraint, values, tuples or term configuration.
|
ConstraintSource |
value(TermSpec indexSpec,
Double weight,
QueryOptions.FragmentScope scope,
String... termOptions)
Deprecated.
Builds a value index specification for use in a constraint, values, tuples or term configuration.
|
QueryOptions.QueryValues |
values(String name,
TupleSource source,
QueryOptions.Aggregate aggregate,
String... valuesOptions)
Deprecated.
Builds a QueryValues object, with an included aggregate specification.
|
QueryOptions.QueryValues |
values(String name,
TupleSource source,
String... valuesOptions)
Deprecated.
Builds a QueryValues object.
|
QueryOptions.QueryWord |
word(TermSpec indexSpec)
Deprecated.
Builds a word index specification for use in a constraint or term configuration.
|
QueryOptions.QueryWord |
word(TermSpec indexSpec,
Double weight,
QueryOptions.FragmentScope scope,
String... options)
Deprecated.
Builds a word index specification for use in a constraint or term configuration.
|
public QueryOptionsConfiguration configure()
public QueryOptions.QueryConstraint constraint(String name, ConstraintSource source)
name
- Name of the constraint. Name is used as a reference from other
configuration options, and also within search strings provided
by the end user.source
- Source of data for the constraint.QueryOptions
configurationspublic QueryOptions.QueryValues values(String name, TupleSource source, String... valuesOptions)
name
- Name for the QueryValues object. Used as a reference in URL
patterns.source
- Specifies source of data for values. Built from either a
collection or uri lexicon, a range index, field, or geospatial
index.valuesOptions
- A list of string options to values calls.public QueryOptions.QueryValues values(String name, TupleSource source, QueryOptions.Aggregate aggregate, String... valuesOptions)
name
- Name for the QueryValues object. Used as a reference in URL
patterns.source
- Specifies source of data for values. Built from either a
collection or uri lexicon, a range index, field, or geospatial
index.aggregate
- A reference to either a built-in aggregate function or a
user-defined function (UDF).valuesOptions
- A list of string options to values calls.public QueryOptions.QueryTuples tuples(String name, List<TupleSource> sources, String... valuesOptions)
name
- Name for the QueryTuples object. Used as a reference in URL
patterns.sources
- Specifies sources of data for tuples. Built from a combination
of two or more collection or uri lexicons, range indexes,
fields, or geospatial indexes.valuesOptions
- A list of string options to values calls.public QueryOptions.QueryTuples tuples(String name, List<TupleSource> sources, QueryOptions.Aggregate aggregate, String... valuesOptions)
name
- Name for the QueryTuples object. Used as a reference in URL
patterns.sources
- Specifies sources of data for tuples. Built from a combination
of two or more collection or uri lexicons, range indexes,
fields, or geospatial indexes.aggregate
- A reference to either a built-in aggregate function or a
user-defined function (UDF).valuesOptions
- A list of string options to values calls.public QueryOptions.QueryOperator operator(String name, QueryOptions.QueryState... states)
name
- Name of the operator. Used in search strings by end-users.states
- A list of states applied when using this operator. Composed
with the state builder methods.public List<QueryOptions.QuerySortOrder> sortOrders(QueryOptions.QuerySortOrder... sortOrders)
sortOrders
- 0 or more QuerySortOrder objectspublic QueryOptions.QuerySortOrder sortOrder(TermSpec indexSpec)
indexSpec
- Contains data source for the sort order.public QueryOptions.QuerySortOrder sortOrder(RangeSpec indexSpec, QueryOptions.QuerySortOrder.Direction direction)
indexSpec
- Contains data source for the sort order as well as typing and
collation information as appropriate.public QueryOptions.QuerySortOrder sortByScore(QueryOptions.QuerySortOrder.Direction direction)
direction
- Either ascending or descending.public QueryOptions.QueryAdditionalQuery additionalQuery(String ctsQuery)
ctsQuery
- A MarkLogic cts:query element, as a string, to be ANDed with
the runtime search options. The string must be valid XML in the
http://marklogic.com/cts namespace.public QueryOptions.QuerySearchableExpression searchableExpression(String searchableExpression, QueryOptions.ExpressionNamespaceBinding... bindings)
searchableExpression
- XPath expression to locate nodes in the search database.bindings
- An array of bindings of prefix to namespace uri. Used to
evaluate prefixes in the searchableExpression XPath string.public QueryOptions.QueryExtractMetadata extractMetadata(MetadataExtract... extractions)
extractions
- Zero or more metadata specifictions to include in resultsQueryOptions
configuration.public QueryOptions.QueryTransformResults rawResults()
QueryOptions
with
withTransformResultspublic QueryOptions.QueryTransformResults emptySnippets()
QueryOptions
with
withTransformResultspublic QueryOptions.QueryTransformResults metadataSnippetTransform(QName... preferredElements)
preferredElements
- Zero or more elements from the properties fragment to include.
If none are specified, last-modified is used.QueryOptions
with
withTransformResultspublic QueryOptions.QueryTransformResults snippetTransform(Integer perMatchTokens, Integer maxMatches, Integer maxSnippetChars, QName... preferredElements)
perMatchTokens
- Maximum number of tokens (typically words) per matching node
that surround the highlighted term(s) in the snippet.maxMatches
- The maximum number of nodes containing a highlighted term that
will display in the snippet.maxSnippetChars
- Limit total snippet size to this many characters.preferredElements
- Zero or more elements that the snippet algorithm looks in
first to find matches.QueryOptions
with
withTransformResultspublic QueryOptions.QueryTransformResults transformResults(QueryOptions.XQueryExtension extension)
extension
- An XQuery extension, build with QueryOptionsBuilder.extensionQueryOptions
with
withTransformResultspublic QueryOptions.QueryGrammar grammar(List<QueryOptions.QueryGrammar.QueryStarter> starters, List<QueryOptions.QueryGrammar.QueryJoiner> joiners, String quotation, Element implicit)
starters
- List of starter configurations, probably returned by the
starter builder method. Starters define how individual search
terms are interpreted.joiners
- List of starter configurations, probably returned by the
joiner builder method. Joiners define how terms are grouped
together into an overall search expression.quotation
- implicit
- QueryOptions
public QueryOptions.QueryTerm term(QueryOptions.XQueryExtension extension)
extension
- An XQuery module that generates terms (?)QueryOptionsHandle
.withTerm()public QueryOptions.QueryTerm term(QueryOptions.QueryTerm.TermApply empty, TermSource defaultSource, String... termOptions)
empty
- Specifies what to do with an empty search. An empty search can
mean either all results or no results.defaultSource
- The source for searches with no named constraint applied.termOptions
- Options that fine-tune behavior of a term configuration.
Valid term options are:
case-sensitive diacritic-sensitive diacritic-insensitive punctuation-sensitive punctuation-insensitive whitespace-sensitive whitespace-insensitive stemmed unstemmed wildcarded unwilcarded exact lang=iso639code
public QueryOptions.QueryTerm term(QueryOptions.QueryTerm.TermApply empty, String defaultSourceName, String... termOptions)
empty
- Specifies what to do with an empty search. An empty search can
mean either all results or no results.defaultSourceName
- The name of a constraint to use when no prefix is used for a
search term.termOptions
- Options that fine-tune behavior of a term configuration.public QueryOptions.QueryTerm term(String... termOptions)
termOptions
- Options that fine-tune behavior of a term configuration.public ConstraintSource properties()
public QueryOptions.QueryCollection collection(String prefix)
prefix
- This value will be trimmed from the start of collection URIs
to provide more readable facet labels.QueryOptions
configurations.public QueryOptions.QueryCollection collection(String prefix, QueryOptions.Facets isFaceted, String... options)
prefix
- This value will be trimmed from the start of collection URIs
to provide more readable facet labels.isFaceted
- Setting to true configures Search API to do facets on this
source.options
- A list of facet options to configure the collection
constraint. Valid facet options are:
ascending descending empties any document properties locks frequency-order item-order fragment-frequency item-frequency type=type timezone=TZ limit=N sample=N truncate=N skip=N score-logtfidf score-logtf score-simple score-random checked unchecked concurrent map
public QueryOptions.QueryElementQuery elementQuery(QName qname)
qname
- QName of the element for restricting QueryOptions.public List<TupleSource> tupleSources(TupleSource... tupleSources)
TupleSource
s from 0..N Tuple Sources.tupleSources
- Zero to N TupleSourcesTupleSource
provided.public QueryOptions.QueryRange range(RangeSpec indexSpec)
indexSpec
- Specification for this range index. Built by one of the XRangeIndex builder methods.public QueryOptions.QueryRange range(RangeSpec indexSpec, QueryOptions.Facets faceted, QueryOptions.FragmentScope scope, List<Buckets> buckets, String... facetOptions)
indexSpec
- Specification for this range index. Built by one of the XRangeIndex builder methods.faceted
- A flag to determine whether this range is faceted or not.scope
- The optional fragment scope for this range.buckets
- a list of buckets or computed buckets for the facetsfacetOptions
- Zero or more options to tune the behavior of facets.public ConstraintSource value(TermSpec indexSpec)
indexSpec
- Specification for this range index. Built by one of the XRangeIndex builder methods.public ConstraintSource value(TermSpec indexSpec, Double weight, QueryOptions.FragmentScope scope, String... termOptions)
indexSpec
- Specification for this range index. Built by one of the XRangeIndex builder methods.weight
- A decimal value to weight this index relative to others in the search results.scope
- The optional fragment scope for this range.termOptions
- Zero or more options to tune the behavior of facets.public QueryOptions.QueryWord word(TermSpec indexSpec)
indexSpec
- The index backing the word configuration.public QueryOptions.QueryWord word(TermSpec indexSpec, Double weight, QueryOptions.FragmentScope scope, String... options)
indexSpec
- Specification for this range index. Built by one of the XRangeIndex builder methods.weight
- A decimal value to weight this index relative to others in the search results.scope
- The optional fragment scope for this range.options
- Zero or more options to tune the behavior of facets.public ConstraintSource customParse(QueryOptions.XQueryExtension parse, String... termOptions)
parse
- Represents a custom XQuery extension (installed by an
administrator) for parsing data into constraint values.termOptions
- Zero or more options for modifying the behavior of the parsed
terms.public ConstraintSource customFacet(QueryOptions.XQueryExtension parse, QueryOptions.XQueryExtension start, QueryOptions.XQueryExtension finish, String... facetOptions)
parse
- An XQuery extension to parse the values provided.start
- An XQuery extension to start categorizing facets.finish
- An XQuery extension to finish categorizing facets.facetOptions
- 0 or more options to affect facet behavior.public ConstraintSource geospatial(GeospatialSpec index, HeatmapAndOptions heatmap, String... geoOptions)
index
- The geospatial index backing this configuration.heatmap
- An optional heatmap for graphical display of results, with facet options bundled in. Use heatmap builder method to provide this argument.geoOptions
- Zero or more options to fine-tune geographic behavior.public ConstraintSource geospatial(GeospatialSpec index, String... geoOptions)
index
- THe geospatial index definition for this constraint configuration.geoOptions
- Zero or more options to fine-tune the behavior of the geospatial constraint.public QueryOptions.QueryState state(String stateName)
stateName
- Describes how this state is exposed to the search string
interface.public TermSpec elementTermIndex(QName element)
element
- QName of an indexed element.public RangeSpec elementRangeIndex(QName element, RangeIndexType type)
element
- QName of an indexed element.type
- An object that encapsulates typing and collation information
for the range index.public TermSpec elementAttributeTermIndex(QName element, QName attribute)
element
- QName of the attribute's parent element.attribute
- QName of the indexed attribute.public RangeSpec elementAttributeRangeIndex(QName element, QName attribute, RangeIndexType type)
element
- QName of an indexed element.attribute
- QName of the indexed attribute.type
- An object that encapsulates typing and collation information
for the range index.public TermSpec fieldTermIndex(String fieldName)
fieldName
- The name of an indexed field.public RangeSpec fieldRangeIndex(String fieldName, RangeIndexType type)
fieldName
- Name of the indexed fieldtype
- An object that encapsulates typing and collation information
for the range index.public TermSpec jsonTermIndex(String jsonKey)
jsonKey
- The name of the indexed JSON key.public RangeSpec jsonRangeIndex(String jsonKey, RangeIndexType type)
jsonKey
- Name of the indexed keytype
- An object that encapsulates typing and collation information
for the range index.public RangeSpec pathIndex(String xPath, QueryOptions.ExpressionNamespaceBinding... bindings)
xPath
- XPath expression to locate nodes in the search database. Must
match path specification of a configured index on the server.bindings
- An array of bindings of prefix to namespace uri. Used to
evaluate prefixes in the searchableExpression XPath string.public RangeSpec pathIndex(String xPath, QueryOptions.ExpressionNamespaceBindings bindings, RangeIndexType type)
xPath
- XPath expression to locate nodes in the search database. Must
match path specification of a configured index on the server.bindings
- An array of bindings of prefix to namespace uri. Used to
evaluate prefixes in the searchableExpression XPath string.type
- An object that encapsulates typing and collation information
for the range index.public GeospatialSpec attributePairGeospatialIndex(QName parent, QName latitudeAttribute, QName longitudeAttribute)
parent
- QName of the element that is a parent to the latitude and
longitude attributes.latitudeAttribute
- QName of the XML Attribute containing latitude.longitudeAttribute
- QName of the XML Attribute constraint longitude.public GeospatialSpec elementPairGeospatialIndex(QName parent, QName latitudeElement, QName longitudeElement)
parent
- QName of the element that is a parent to the latitude and
longitude elements.latitudeElement
- QName of the XML Element containing latitude.longitudeElement
- QName of the XML Element constraint longitude.public GeospatialSpec elementGeospatialIndex(QName geospatialElement)
geospatialElement
- QName of the element that stores geographic coordinates. The
coordinates are comma-delimited. Default is that latitude
precedes longitude. If longitude precedes latitude in your
data, use a geo-option called "long-lat-points" on the
enclosing geospatial builder method.public GeospatialSpec elementChildGeospatialIndex(QName parent, QName geospatialElement)
parent
- QName of the element that is the parent of geospatial coordinates.geospatialElement
- QName of the element that contains coordinates. The
coordinates are comma-delimited. Default is that latitude
precedes longitude. If longitude precedes latitude in your
data, use a geo-option called "long-lat-points" on the
enclosing geospatial builder method.public HeatmapAndOptions heatmap(double south, double west, double north, double east, int latitudeDivs, int longitudeDivs, String... options)
south
- Southern boundary of the heatmap.west
- Western boundary of the heatmap.north
- Northern boundary of the heatmap.east
- Eastern boundary of the heatmap.latitudeDivs
- Number of regions along the north-south axis..longitudeDivs
- Number of regions along the east-west axis.options
- 0 or more string options to affect the heatmap.public QueryOptions.ExpressionNamespaceBinding ns(String prefix, String namespaceURI)
prefix
- A prefix for us in xPath expressions.namespaceURI
- A namespace URI to be bound to the above prefix.public QueryOptions.QueryRange.Bucket bucket(String name, String label, String ge, String lt)
QueryOptions.QueryRange
configurationname
- Name of bucket, for use in query strings.label
- Label of bucket when displayed in facet results.ge
- Upper bound of bucketlt
- Lower bound of bucketpublic QueryOptions.QueryRange.ComputedBucket computedBucket(String name, String label, String ge, String lt, QueryOptions.QueryRange.ComputedBucket.AnchorValue anchor)
QueryOptions.QueryRange
name
- Name of bucket, for use in query strings.label
- Label of bucket when displayed in facet results.ge
- Upper bound of bucket, relative to anchor.lt
- Lower bound of bucket, relative to anchor.anchor
- Value to provide anchor for relative terms used in ge and lt.public QueryOptions.ConstraintValue constraintValue(String constraintName)
constraintName
- Name of a constraint defined elsewhere in the search options.public QueryUri uri()
public QueryOptions.Field field(String name)
Field with given name must exist on the REST server to be used.
name
- Name of a field from the REST serverpublic QueryOptions.Aggregate aggregate(String aggregateFunctionName)
aggregateFunctionName
- The name of a builtin aggregate function.public QueryOptions.Aggregate aggregate(String aggregateFunctionName, String aggregatePlugin)
aggregateFunctionName
- The name of a builtin aggregate function.aggregatePlugin
- The name of the plugin that supplies the user-defined
functino.public QueryOptions.XQueryExtension extension(String apply, String ns, String at)
To locate XQuery extensions , you need three values. Generally these values are to be provided by a MarkLogic administrator who has installed the modules.
apply
- Name of function to apply.ns
- Namespace of module in which to locate the function.at
- Location on the modules search path at which to find the
function.public RangeIndexType stringRangeType(String collation)
collation
- The collation to use for a range index.public RangeIndexType rangeType(String type)
type
- The XML schema type backing the index. This is a string in "xs:string" form.public List<Buckets> buckets(Buckets... buckets)
buckets
- Zero or more bucketspublic QueryOptions.ElementValue elementValue(QName elemName)
elemName
- QName of the source element.public QueryOptions.AttributeValue attributeValue(QName elemName, QName attrName)
elemName
- QName of the source attribute's parent element.attrName
- QName of the attribute.public QueryOptions.JsonKey jsonValue(String keyName)
keyName
- Name of the source json key.public List<QueryOptions.QueryGrammar.QueryStarter> starters(QueryOptions.QueryGrammar.QueryStarter... starters)
starters
- Zero or more starters, created with the starterGrouping or starterPrefix methods.public QueryOptions.QueryGrammar.QueryStarter starterGrouping(String text, int strength, String delimiter)
text
- The text that starts a group of terms.strength
- The strength of this starter relative to other parts of the grammar.delimiter
- The text that delimits terms.public QueryOptions.QueryGrammar.QueryStarter starterPrefix(String text, int strength, String element)
text
- The text that prefixes a term.strength
- The strength of this starter relative to other parts of the grammar.element
- A String of form "cts:query", which is the name of cts:query element.public List<QueryOptions.QueryGrammar.QueryJoiner> joiners(QueryOptions.QueryGrammar.QueryJoiner... joiners)
QueryOptions.QueryGrammar.QueryJoiner
for use in constructing QueryOptions.QueryGrammar
instances.joiners
- Zero or more joiners, created with the joiner methods.public QueryOptions.QueryGrammar.QueryJoiner joiner(String joinerText, int strength, QueryOptions.QueryGrammar.QueryJoiner.JoinerApply apply)
QueryOptions.QueryGrammar
.
This method is for a simple joiner with just three arguments.
<search:joiner strength="50" apply="constraint">:</search:joiner>
joinerText
- Text of the joiner (here, ":")strength
- Strength of this joiner in relation to other joiners.apply
- Scope of joiner application.public QueryOptions.QueryGrammar.QueryJoiner joiner(String joinerText, int strength, QueryOptions.QueryGrammar.QueryJoiner.JoinerApply apply, QueryOptions.QueryGrammar.QueryJoiner.Comparator comparator, QueryOptions.QueryGrammar.Tokenize tokenize)
QueryOptions.QueryGrammar
joinerText
- Text of the joiner.strength
- Strength of this joiner relative to others.apply
- Enum to specify how the joiner fits into the Search grammar.comparator
- Enum to define semantics of the joinertokenize
- Enum to specify how the joiner tokenizes the search string.public QueryOptions.QueryGrammar.QueryJoiner joiner(String joinerText, int strength, QueryOptions.QueryGrammar.QueryJoiner.JoinerApply apply, String element, QueryOptions.QueryGrammar.Tokenize token)
QueryOptions.QueryGrammar
joinerText
- Text of the joiner.strength
- Strength of this joiner relative to others.apply
- Enum to specify how the joiner fits into the Search grammar.element
- A String of form "cts:query", which is the name of cts:query element.token
- Enum to specify how the joiner tokenizes the search string.public QueryOptions.QueryGrammar.QueryJoiner joiner(String joinerText, int strength, QueryOptions.QueryGrammar.QueryJoiner.JoinerApply apply, String element, QueryOptions.QueryGrammar.Tokenize tokenize, Integer consume)
QueryOptions.QueryGrammar
This method includes 'consume' which
specifies how far to extend the scope of a cts:near-query query.joinerText
- Text of the joiner.strength
- Strength of this joiner relative to others.apply
- Enum to specify how the joiner fits into the Search grammar.element
- A String of form "cts:query", which is the name of cts:query element.tokenize
- Enum to specify how the joiner tokenizes the search string.consume
- How many tokens to consume for evaluating the near-querypublic QueryOptions.ExpressionNamespaceBindings namespaces(QueryOptions.ExpressionNamespaceBinding... namespaces)
QueryOptions.PathIndex
or QueryOptions.QuerySearchableExpression
configuration.namespaces
- Zero or more namespace/prefix bindingsCopyright © 2013-2015 MarkLogic Corporation.