public class StructuredQueryBuilder
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
SEARCH_API_NS |
Constructor and Description |
---|
StructuredQueryBuilder()
Zero-argument constructor.
|
StructuredQueryBuilder(IterableNamespaceContext namespaces)
Constructs a query builder for queries using the specified
namespace bindings.
|
StructuredQueryBuilder(java.lang.String optionsName)
Constructs a query builder for queries against the options
persisted with the specified name.
|
StructuredQueryBuilder(java.lang.String optionsName,
IterableNamespaceContext namespaces)
Constructs a query builder for queries against the options
persisted with the specified name using the specified
namespace bindings.
|
Modifier and Type | Method and Description |
---|---|
StructuredQueryDefinition |
afterQuery(long timestamp)
Matches documents with timestamp after the given timestamp.
|
StructuredQueryDefinition |
and(StructuredQueryDefinition... queries)
Defines an AND query over the list of query definitions.
|
StructuredQueryDefinition |
andNot(StructuredQueryDefinition positive,
StructuredQueryDefinition negative)
Defines an AND NOT query combining a positive and negative
query.
|
StructuredQueryBuilder.Attribute |
attribute(javax.xml.namespace.QName qname)
Identifies a namespaced attribute to match with a query.
|
StructuredQueryBuilder.Attribute |
attribute(java.lang.String name)
Identifies a simple attribute to match with a query.
|
StructuredQueryBuilder.Axis |
axis(java.lang.String name)
Identify an axis for use in
temporalPeriodRange
or temporalPeriodCompare queries. |
StructuredQueryDefinition |
beforeQuery(long timestamp)
Matches documents with timestamp prior to the given timestamp.
|
StructuredQueryDefinition |
boost(StructuredQueryDefinition matchingQuery,
StructuredQueryDefinition boostingQuery)
Defines a boost query for the matching and boosting query definitions.
|
StructuredQueryBuilder.Box |
box(double south,
double west,
double north,
double east)
Specifies a geospatial region as a box, supplying
the coordinates for the perimeter.
|
RawStructuredQueryDefinition |
build(StructuredQueryDefinition... queries)
Builds a structured query in XML from the list of query definitions.
|
StructuredQueryBuilder.Circle |
circle(double latitude,
double longitude,
double radius)
Specifies a geospatial region as a circle,
supplying coordinates for the center.
|
StructuredQueryBuilder.Circle |
circle(StructuredQueryBuilder.Point center,
double radius)
Specifies a geospatial region as a circle,
supplying a point for the center.
|
StructuredQueryDefinition |
collection(java.lang.String... uris)
Matches documents belonging to at least one
of the criteria collections.
|
StructuredQueryDefinition |
collectionConstraint(java.lang.String constraintName,
java.lang.String... uris)
Matches documents belonging to at least one
of the criteria collections with the specified constraint.
|
StructuredQueryDefinition |
containerConstraint(java.lang.String constraintName,
StructuredQueryDefinition query)
Matches a query within the substructure of the container specified
by the constraint.
|
StructuredQueryDefinition |
containerQuery(StructuredQueryBuilder.ContainerIndex index,
StructuredQueryDefinition query)
Matches a query within the substructure contained by an element or JSON property.
|
StructuredQueryDefinition |
customConstraint(java.lang.String constraintName,
java.lang.String... text)
Matches documents as specified by a constraint that implements
a custom query parameterized with the supplied text.
|
StructuredQueryDefinition |
directory(boolean isInfinite,
java.lang.String... uris)
Matches documents at the specified depth within at least one
of the criteria directories.
|
StructuredQueryDefinition |
directory(int depth,
java.lang.String... uris)
Matches documents at the specified depth within at least one
of the criteria directories.
|
StructuredQueryDefinition |
document(java.lang.String... uris)
Matches the specified documents.
|
StructuredQueryDefinition |
documentFragment(StructuredQueryDefinition query)
Associates a query with the content of documents (as opposed to
the properties of documents).
|
StructuredQueryBuilder.Element |
element(javax.xml.namespace.QName qname)
Identifies a namespaced element to match with a query.
|
StructuredQueryBuilder.Element |
element(java.lang.String name)
Identifies a simple element to match with a query.
|
StructuredQueryBuilder.ElementAttribute |
elementAttribute(StructuredQueryBuilder.Element element,
StructuredQueryBuilder.Attribute attribute)
Identifies an element having an attribute to match with a query.
|
StructuredQueryBuilder.Field |
field(java.lang.String name)
Identifies a field to match with a query.
|
StructuredQueryBuilder.GeospatialIndex |
geoAttributePair(StructuredQueryBuilder.Element parent,
StructuredQueryBuilder.Attribute lat,
StructuredQueryBuilder.Attribute lon)
Identifies a parent element with child latitude and longitude attributes
to match with a geospatial query.
|
StructuredQueryBuilder.GeospatialIndex |
geoElement(StructuredQueryBuilder.Element element)
Identifies an element whose text has the latitude and longitude
coordinates to match with a geospatial query.
|
StructuredQueryBuilder.GeospatialIndex |
geoElement(StructuredQueryBuilder.Element parent,
StructuredQueryBuilder.Element element)
Identifies a parent element with a child element whose text has
the latitude and longitude coordinates to match with a geospatial query.
|
StructuredQueryBuilder.GeospatialIndex |
geoElementPair(StructuredQueryBuilder.Element parent,
StructuredQueryBuilder.Element lat,
StructuredQueryBuilder.Element lon)
Identifies a parent element with child latitude and longitude elements
to match with a geospatial query.
|
StructuredQueryBuilder.GeospatialIndex |
geoJSONProperty(StructuredQueryBuilder.JSONProperty jsonProperty)
Identifies a json property whose text has the point format latitude and longitude
coordinates to match with a geospatial query.
|
StructuredQueryBuilder.GeospatialIndex |
geoJSONProperty(StructuredQueryBuilder.JSONProperty parent,
StructuredQueryBuilder.JSONProperty jsonProperty)
Identifies a parent json property with a child json property whose text has
the latitude and longitude coordinates to match with a geospatial query.
|
StructuredQueryBuilder.GeospatialIndex |
geoJSONPropertyPair(StructuredQueryBuilder.JSONProperty parent,
StructuredQueryBuilder.JSONProperty lat,
StructuredQueryBuilder.JSONProperty lon)
Identifies a parent json property with child latitude and longitude json properties
to match with a geospatial query.
|
StructuredQueryBuilder.GeospatialIndex |
geoPath(StructuredQueryBuilder.PathIndex pathIndex)
Identifies a path with the latitude and longitude to match
with a geospatial query.
|
StructuredQueryBuilder.GeospatialRegionIndex |
geoRegionPath(StructuredQueryBuilder.PathIndex pathIndex)
Identifies a path with regions to match
with a geospatial query.
|
StructuredQueryBuilder.GeospatialRegionIndex |
geoRegionPath(StructuredQueryBuilder.PathIndex pathIndex,
StructuredQueryBuilder.CoordinateSystem coordinateSystem)
Identifies a path with regions to match
with a geospatial query.
|
StructuredQueryDefinition |
geospatial(StructuredQueryBuilder.GeospatialIndex index,
StructuredQueryBuilder.FragmentScope scope,
java.lang.String[] options,
java.lang.Double weight,
StructuredQueryBuilder.Region... regions)
Matches an element, element pair, element attribute, pair, or path
specifying a geospatial point that appears within one of the criteria regions.
|
StructuredQueryDefinition |
geospatial(StructuredQueryBuilder.GeospatialIndex index,
StructuredQueryBuilder.FragmentScope scope,
java.lang.String[] options,
StructuredQueryBuilder.Region... regions)
Matches an element, element pair, element attribute, pair, or path
specifying a geospatial point that appears within one of the criteria regions.
|
StructuredQueryDefinition |
geospatial(StructuredQueryBuilder.GeospatialIndex index,
StructuredQueryBuilder.Region... regions)
Matches an element, element pair, element attribute, pair, or path
specifying a geospatial point that appears within one of the criteria regions.
|
StructuredQueryDefinition |
geospatial(StructuredQueryBuilder.GeospatialRegionIndex index,
StructuredQueryBuilder.GeospatialOperator operator,
StructuredQueryBuilder.FragmentScope scope,
java.lang.String[] options,
java.lang.Double weight,
StructuredQueryBuilder.Region... regions)
Matches a path specifying a geospatial region, which is indexed via
geospatial region index, that has the relationship given by the operator
with at least one of the criteria regions.
|
StructuredQueryDefinition |
geospatial(StructuredQueryBuilder.GeospatialRegionIndex index,
StructuredQueryBuilder.GeospatialOperator operator,
StructuredQueryBuilder.FragmentScope scope,
java.lang.String[] options,
StructuredQueryBuilder.Region... regions)
Matches a path specifying a geospatial region, which is indexed via
geospatial region index, that has the relationship given by the operator
with at least one of the criteria regions.
|
StructuredQueryDefinition |
geospatial(StructuredQueryBuilder.GeospatialRegionIndex index,
StructuredQueryBuilder.GeospatialOperator operator,
StructuredQueryBuilder.Region... regions)
Matches a path specifying a geospatial region, which is indexed via
geospatial region index, that has the relationship given by the operator
with at least one of the criteria regions.
|
StructuredQueryBuilder.GeospatialConstraintQuery |
geospatialConstraint(java.lang.String constraintName,
StructuredQueryBuilder.Region... regions)
Matches the container specified by the constraint
whose geospatial point appears within one of the criteria regions.
|
StructuredQueryDefinition |
geospatialRegionConstraint(java.lang.String constraintName,
StructuredQueryBuilder.GeospatialOperator operator,
StructuredQueryBuilder.Region... regions)
Matches the container specified by the constraint
whose geospatial region appears within one of the criteria regions.
|
IterableNamespaceContext |
getNamespaces()
Gets the namespace bindings used for the query.
|
StructuredQueryBuilder.JSONProperty |
jsonProperty(java.lang.String name)
Identifies a JSON property to match with a query.
|
StructuredQueryDefinition |
locks(StructuredQueryDefinition query)
Associates a query with durable locks on documents (as opposed to
the content or properties of documents).
|
StructuredQueryDefinition |
near(int maximumDistance,
double weight,
StructuredQueryBuilder.Ordering order,
StructuredQueryDefinition... queries)
Defines a NEAR query over the list of query definitions
with specified parameters.
|
StructuredQueryDefinition |
near(int minimumDistance,
int maximumDistance,
double weight,
StructuredQueryBuilder.Ordering order,
StructuredQueryDefinition... queries)
Defines a NEAR query over the list of query definitions
with specified parameters.
|
StructuredQueryDefinition |
near(StructuredQueryDefinition... queries)
Defines a NEAR query over the list of query definitions
with default parameters.
|
StructuredQueryDefinition |
not(StructuredQueryDefinition query)
Defines a NOT query for a query definition.
|
StructuredQueryDefinition |
notIn(StructuredQueryDefinition positive,
StructuredQueryDefinition negative)
Defines a not-in query for the positive and negative query definitions.
|
StructuredQueryDefinition |
or(StructuredQueryDefinition... queries)
Defines an OR query over the list of query definitions.
|
StructuredQueryBuilder.PathIndex |
pathIndex(java.lang.String path)
Identifies a path index to match with a query.
|
StructuredQueryBuilder.Period |
period(java.util.Calendar start,
java.util.Calendar end)
Construct a temporal period for use in
temporalPeriodRange
queries. |
StructuredQueryBuilder.Period |
period(java.lang.String start,
java.lang.String end)
Construct a temporal period for use in
temporalPeriodRange
queries. |
StructuredQueryBuilder.Point |
point(double latitude,
double longitude)
Specifies a geospatial point.
|
StructuredQueryBuilder.Polygon |
polygon(StructuredQueryBuilder.Point... points)
Specifies a geospatial region as an arbitrary polygon.
|
StructuredQueryDefinition |
properties(StructuredQueryDefinition query)
Associates a query with the properties of documents (as opposed to
the content of documents).
|
StructuredQueryDefinition |
propertiesConstraint(java.lang.String constraintName,
StructuredQueryDefinition query)
Associates a query with the properties of documents (as opposed to
the content of documents) with the specified constraint.
|
StructuredQueryDefinition |
range(StructuredQueryBuilder.RangeIndex index,
java.lang.String type,
java.lang.String[] options,
double weight,
StructuredQueryBuilder.Operator operator,
java.lang.Object... values)
Matches an element, attribute, JSON property, field, or path
whose value that has the correct datatyped comparison with
one of the criteria values.
|
StructuredQueryDefinition |
range(StructuredQueryBuilder.RangeIndex index,
java.lang.String type,
java.lang.String[] options,
StructuredQueryBuilder.Operator operator,
java.lang.Object... values)
Matches an element, attribute, JSON property, field, or path
whose value that has the correct datatyped comparison with
one of the criteria values.
|
StructuredQueryDefinition |
range(StructuredQueryBuilder.RangeIndex index,
java.lang.String type,
java.lang.String collation,
java.lang.String[] options,
double weight,
StructuredQueryBuilder.Operator operator,
java.lang.Object... values)
Matches an element, attribute, JSON property, field, or path
whose value that has the correct datatyped comparison with
one of the criteria values.
|
StructuredQueryDefinition |
range(StructuredQueryBuilder.RangeIndex index,
java.lang.String type,
java.lang.String collation,
java.lang.String[] options,
StructuredQueryBuilder.Operator operator,
java.lang.Object... values)
Matches an element, attribute, JSON property, field, or path
whose value that has the correct datatyped comparison with
one of the criteria values.
|
StructuredQueryDefinition |
range(StructuredQueryBuilder.RangeIndex index,
java.lang.String type,
java.lang.String collation,
StructuredQueryBuilder.FragmentScope scope,
java.lang.String[] options,
double weight,
StructuredQueryBuilder.Operator operator,
java.lang.Object... values)
Matches an element, attribute, JSON property, field, or path
whose value that has the correct datatyped comparison with
one of the criteria values.
|
StructuredQueryDefinition |
range(StructuredQueryBuilder.RangeIndex index,
java.lang.String type,
java.lang.String collation,
StructuredQueryBuilder.FragmentScope scope,
java.lang.String[] options,
StructuredQueryBuilder.Operator operator,
java.lang.Object... values)
Matches an element, attribute, JSON property, field, or path
whose value that has the correct datatyped comparison with
one of the criteria values.
|
StructuredQueryDefinition |
range(StructuredQueryBuilder.RangeIndex index,
java.lang.String type,
java.lang.String collation,
StructuredQueryBuilder.FragmentScope scope,
StructuredQueryBuilder.Operator operator,
java.lang.Object... values)
Matches an element, attribute, JSON property, field, or path
whose value that has the correct datatyped comparison with
one of the criteria values.
|
StructuredQueryDefinition |
range(StructuredQueryBuilder.RangeIndex index,
java.lang.String type,
java.lang.String collation,
StructuredQueryBuilder.Operator operator,
java.lang.Object... values)
Matches an element, attribute, JSON property, field, or path
whose value that has the correct datatyped comparison with
one of the criteria values.
|
StructuredQueryDefinition |
range(StructuredQueryBuilder.RangeIndex index,
java.lang.String type,
StructuredQueryBuilder.Operator operator,
java.lang.Object... values)
Matches an element, attribute, JSON property, field, or path
whose value that has the correct datatyped comparison with
one of the criteria values.
|
StructuredQueryDefinition |
rangeConstraint(java.lang.String constraintName,
StructuredQueryBuilder.Operator operator,
java.lang.String... values)
Matches the container specified by the constraint
whose value that has the correct datatyped comparison with
one of the criteria values.
|
java.lang.String[] |
rangeOptions(java.lang.String... options)
Converts the list of options used for a range query to an array
as a convenience.
|
void |
setNamespaces(IterableNamespaceContext namespaces)
Specifies the namespace bindings used for the query.
|
StructuredQueryDefinition |
temporalLsqtQuery(java.lang.String temporalCollection,
java.util.Calendar time,
double weight,
java.lang.String... options)
Matches documents with LSQT prior to timestamp
|
StructuredQueryDefinition |
temporalLsqtQuery(java.lang.String temporalCollection,
java.lang.String timestamp,
double weight,
java.lang.String... options)
Matches documents with LSQT prior to timestamp
|
StructuredQueryDefinition |
temporalPeriodCompare(StructuredQueryBuilder.Axis axis1,
StructuredQueryBuilder.TemporalOperator operator,
StructuredQueryBuilder.Axis axis2,
java.lang.String... options)
Matches documents that have a relevant pair of period values.
|
StructuredQueryDefinition |
temporalPeriodRange(StructuredQueryBuilder.Axis[] axes,
StructuredQueryBuilder.TemporalOperator operator,
StructuredQueryBuilder.Period[] periods,
java.lang.String... options)
Matches documents that have a value in the specified axis that matches the specified
periods using the specified operator.
|
StructuredQueryDefinition |
temporalPeriodRange(StructuredQueryBuilder.Axis axis,
StructuredQueryBuilder.TemporalOperator operator,
StructuredQueryBuilder.Period period,
java.lang.String... options)
Matches documents that have a value in the specified axis that matches the specified
period using the specified operator.
|
StructuredQueryDefinition |
term(double weight,
java.lang.String... terms)
Matches documents containing the specified terms, modifying
the contribution of the match to the score with the weight.
|
StructuredQueryDefinition |
term(java.lang.String... terms)
Matches documents containing the specified terms.
|
StructuredQueryDefinition |
value(StructuredQueryBuilder.TextIndex index,
java.lang.Boolean value)
Matches a JSON property that has a value with the same boolean value
as at least one of the criteria values.
|
StructuredQueryDefinition |
value(StructuredQueryBuilder.TextIndex index,
java.lang.Number... values)
Matches an JSON property that has a value with the same numeric
value as at least one of the criteria values.
|
StructuredQueryDefinition |
value(StructuredQueryBuilder.TextIndex index,
java.lang.String... values)
Matches an element, attribute, JSON property, or field
that has a value with the same string value as at least one
of the criteria values.
|
StructuredQueryDefinition |
value(StructuredQueryBuilder.TextIndex index,
StructuredQueryBuilder.FragmentScope scope,
java.lang.String[] options,
double weight,
java.lang.Boolean value)
Matches a JSON property that has a value with the same boolean
value as at least one of the criteria values.
|
StructuredQueryDefinition |
value(StructuredQueryBuilder.TextIndex index,
StructuredQueryBuilder.FragmentScope scope,
java.lang.String[] options,
double weight,
java.lang.Number... values)
Matches a JSON property that has a value with the same numeric
value as at least one of the criteria values.
|
StructuredQueryDefinition |
value(StructuredQueryBuilder.TextIndex index,
StructuredQueryBuilder.FragmentScope scope,
java.lang.String[] options,
double weight,
java.lang.String... values)
Matches an element, attribute, JSON property, or field
that has a value with the same string value as at least one
of the criteria values.
|
StructuredQueryDefinition |
valueConstraint(java.lang.String constraintName,
double weight,
java.lang.String... values)
Matches the container specified by the constraint when it
has a value with the same string value as at least one
of the criteria values.
|
StructuredQueryDefinition |
valueConstraint(java.lang.String constraintName,
java.lang.String... values)
Matches the container specified by the constraint when it
has a value with the same string value as at least one
of the criteria values.
|
StructuredQueryDefinition |
word(StructuredQueryBuilder.TextIndex index,
java.lang.String... words)
Matches an element, attribute, JSON property, or field
that has at least one of the criteria words.
|
StructuredQueryDefinition |
word(StructuredQueryBuilder.TextIndex index,
StructuredQueryBuilder.FragmentScope scope,
java.lang.String[] options,
double weight,
java.lang.String... words)
Matches an element, attribute, JSON property, or field
that has at least one of the criteria words.
|
StructuredQueryDefinition |
wordConstraint(java.lang.String constraintName,
double weight,
java.lang.String... words)
Matches the container specified by the constraint when it
has at least one of the criteria words.
|
StructuredQueryDefinition |
wordConstraint(java.lang.String constraintName,
java.lang.String... words)
Matches the container specified by the constraint when it
has at least one of the criteria words.
|
public static final java.lang.String SEARCH_API_NS
public StructuredQueryBuilder()
public StructuredQueryBuilder(java.lang.String optionsName)
optionsName
- the name of the persisted query optionspublic StructuredQueryBuilder(IterableNamespaceContext namespaces)
namespaces
- the bindings of prefixes and namespacespublic StructuredQueryBuilder(java.lang.String optionsName, IterableNamespaceContext namespaces)
optionsName
- the name of the persisted query optionsnamespaces
- the bindings of prefixes and namespacespublic RawStructuredQueryDefinition build(StructuredQueryDefinition... queries)
queries
- the query definitionspublic StructuredQueryDefinition and(StructuredQueryDefinition... queries)
queries
- the query definitionspublic StructuredQueryDefinition or(StructuredQueryDefinition... queries)
queries
- the query definitionspublic StructuredQueryDefinition not(StructuredQueryDefinition query)
query
- the query definitionpublic StructuredQueryDefinition andNot(StructuredQueryDefinition positive, StructuredQueryDefinition negative)
positive
- the positive query definitionnegative
- the negative query definitionpublic StructuredQueryDefinition near(StructuredQueryDefinition... queries)
queries
- the query definitionspublic StructuredQueryDefinition near(int maximumDistance, double weight, StructuredQueryBuilder.Ordering order, StructuredQueryDefinition... queries)
maximumDistance
- the maximum distance (in number of words) between any two matching
queriesweight
- the weight for the queryorder
- the ordering for the query termsqueries
- the query definitionspublic StructuredQueryDefinition near(int minimumDistance, int maximumDistance, double weight, StructuredQueryBuilder.Ordering order, StructuredQueryDefinition... queries)
minimumDistance
- the minimum distance (in number of words) between any two matching
queriesmaximumDistance
- the maximum distance (in number of words) between any two matching
queriesweight
- the weight for the queryorder
- the ordering for the query termsqueries
- the query definitionspublic StructuredQueryDefinition documentFragment(StructuredQueryDefinition query)
query
- the query definitionpublic StructuredQueryDefinition properties(StructuredQueryDefinition query)
query
- the query definitionpublic StructuredQueryDefinition locks(StructuredQueryDefinition query)
query
- the query definitionpublic StructuredQueryDefinition containerQuery(StructuredQueryBuilder.ContainerIndex index, StructuredQueryDefinition query)
index
- the element or JSON propertyquery
- the query over the contained substructurepublic StructuredQueryDefinition collection(java.lang.String... uris)
uris
- the identifiers for the criteria collectionspublic StructuredQueryDefinition directory(boolean isInfinite, java.lang.String... uris)
isInfinite
- true to match a document at any level of depthuris
- the identifiers for the criteria directoriespublic StructuredQueryDefinition directory(int depth, java.lang.String... uris)
depth
- specifies how many subdirectories deep to traverse
A value of 1 means to exclude subdirectories.uris
- the identifiers for the criteria directoriespublic StructuredQueryDefinition document(java.lang.String... uris)
uris
- the identifiers for the documentspublic StructuredQueryDefinition term(java.lang.String... terms)
terms
- the possible terms to matchpublic StructuredQueryDefinition term(double weight, java.lang.String... terms)
weight
- the multiplier for the match in the document rankingterms
- the possible terms to matchpublic StructuredQueryDefinition value(StructuredQueryBuilder.TextIndex index, java.lang.String... values)
index
- the value containervalues
- the possible values to matchpublic StructuredQueryDefinition value(StructuredQueryBuilder.TextIndex index, java.lang.Boolean value)
index
- the value containervalue
- either true or falsepublic StructuredQueryDefinition value(StructuredQueryBuilder.TextIndex index, java.lang.Number... values)
index
- the value containervalues
- the possible values to matchpublic StructuredQueryDefinition value(StructuredQueryBuilder.TextIndex index, StructuredQueryBuilder.FragmentScope scope, java.lang.String[] options, double weight, java.lang.String... values)
index
- the value containerscope
- whether the query matches the document content or propertiesoptions
- options for fine tuning the queryweight
- the multiplier for the match in the document rankingvalues
- the possible values to matchpublic StructuredQueryDefinition value(StructuredQueryBuilder.TextIndex index, StructuredQueryBuilder.FragmentScope scope, java.lang.String[] options, double weight, java.lang.Boolean value)
index
- the value containerscope
- whether the query matches the document content or propertiesoptions
- options for fine tuning the queryweight
- the multiplier for the match in the document rankingvalue
- either true or falsepublic StructuredQueryDefinition value(StructuredQueryBuilder.TextIndex index, StructuredQueryBuilder.FragmentScope scope, java.lang.String[] options, double weight, java.lang.Number... values)
index
- the value containerscope
- whether the query matches the document content or propertiesoptions
- options for fine tuning the queryweight
- the multiplier for the match in the document rankingvalues
- the possible values to matchpublic StructuredQueryDefinition word(StructuredQueryBuilder.TextIndex index, java.lang.String... words)
index
- the word containerwords
- the possible words to matchpublic StructuredQueryDefinition word(StructuredQueryBuilder.TextIndex index, StructuredQueryBuilder.FragmentScope scope, java.lang.String[] options, double weight, java.lang.String... words)
index
- the word containerscope
- whether the query matches the document content or propertiesoptions
- options for fine tuning the queryweight
- the multiplier for the match in the document rankingwords
- the possible words to matchpublic StructuredQueryDefinition range(StructuredQueryBuilder.RangeIndex index, java.lang.String type, StructuredQueryBuilder.Operator operator, java.lang.Object... values)
index
- the range containertype
- the datatype of the container and specified valuesoperator
- the comparison with the criteria valuesvalues
- the possible datatyped values for the comparisonpublic StructuredQueryDefinition range(StructuredQueryBuilder.RangeIndex index, java.lang.String type, java.lang.String collation, StructuredQueryBuilder.Operator operator, java.lang.Object... values)
index
- the range containertype
- the datatype of the container and specified valuescollation
- the identifier for the strategy for comparing typesoperator
- the comparison with the criteria valuesvalues
- the possible datatyped values for the comparisonpublic StructuredQueryDefinition range(StructuredQueryBuilder.RangeIndex index, java.lang.String type, java.lang.String collation, StructuredQueryBuilder.FragmentScope scope, StructuredQueryBuilder.Operator operator, java.lang.Object... values)
index
- the range containertype
- the datatype of the container and specified valuescollation
- the identifier for the strategy for comparing typesscope
- whether the query matches the document content or propertiesoperator
- the comparison with the criteria valuesvalues
- the possible datatyped values for the comparisonpublic StructuredQueryDefinition range(StructuredQueryBuilder.RangeIndex index, java.lang.String type, java.lang.String[] options, StructuredQueryBuilder.Operator operator, java.lang.Object... values)
index
- the range containertype
- the datatype of the container and specified valuesoptions
- options for fine tuning the queryoperator
- the comparison with the criteria valuesvalues
- the possible datatyped values for the comparisonpublic StructuredQueryDefinition range(StructuredQueryBuilder.RangeIndex index, java.lang.String type, java.lang.String[] options, double weight, StructuredQueryBuilder.Operator operator, java.lang.Object... values)
index
- the range containertype
- the datatype of the container and specified valuesoptions
- options for fine tuning the queryweight
- the multiplier for the match in the document rankingoperator
- the comparison with the criteria valuesvalues
- the possible datatyped values for the comparisonpublic StructuredQueryDefinition range(StructuredQueryBuilder.RangeIndex index, java.lang.String type, java.lang.String collation, java.lang.String[] options, StructuredQueryBuilder.Operator operator, java.lang.Object... values)
index
- the range containertype
- the datatype of the container and specified valuescollation
- the identifier for the strategy for comparing typesoptions
- options for fine tuning the queryoperator
- the comparison with the criteria valuesvalues
- the possible datatyped values for the comparisonpublic StructuredQueryDefinition range(StructuredQueryBuilder.RangeIndex index, java.lang.String type, java.lang.String collation, java.lang.String[] options, double weight, StructuredQueryBuilder.Operator operator, java.lang.Object... values)
index
- the range containertype
- the datatype of the container and specified valuescollation
- the identifier for the strategy for comparing typesoptions
- options for fine tuning the queryweight
- the multiplier for the match in the document rankingoperator
- the comparison with the criteria valuesvalues
- the possible datatyped values for the comparisonpublic StructuredQueryDefinition range(StructuredQueryBuilder.RangeIndex index, java.lang.String type, java.lang.String collation, StructuredQueryBuilder.FragmentScope scope, java.lang.String[] options, StructuredQueryBuilder.Operator operator, java.lang.Object... values)
index
- the range containertype
- the datatype of the container and specified valuescollation
- the identifier for the strategy for comparing typesscope
- whether the query matches the document content or propertiesoptions
- options for fine tuning the queryoperator
- the comparison with the criteria valuesvalues
- the possible datatyped values for the comparisonpublic StructuredQueryDefinition range(StructuredQueryBuilder.RangeIndex index, java.lang.String type, java.lang.String collation, StructuredQueryBuilder.FragmentScope scope, java.lang.String[] options, double weight, StructuredQueryBuilder.Operator operator, java.lang.Object... values)
index
- the range containertype
- the datatype of the container and specified valuescollation
- the identifier for the strategy for comparing typesscope
- whether the query matches the document content or propertiesoptions
- options for fine tuning the queryweight
- the multiplier for the match in the document rankingoperator
- the comparison with the criteria valuesvalues
- the possible datatyped values for the comparisonpublic StructuredQueryDefinition geospatial(StructuredQueryBuilder.GeospatialIndex index, StructuredQueryBuilder.Region... regions)
index
- the container for the coordinates of the geospatial pointregions
- the possible regions containing the pointpublic StructuredQueryDefinition geospatial(StructuredQueryBuilder.GeospatialIndex index, StructuredQueryBuilder.FragmentScope scope, java.lang.String[] options, StructuredQueryBuilder.Region... regions)
index
- the container for the coordinates of the geospatial pointscope
- whether the query matches the document content or propertiesoptions
- options for fine tuning the queryregions
- the possible regions containing the pointpublic StructuredQueryDefinition geospatial(StructuredQueryBuilder.GeospatialIndex index, StructuredQueryBuilder.FragmentScope scope, java.lang.String[] options, java.lang.Double weight, StructuredQueryBuilder.Region... regions)
index
- the container for the coordinates of the geospatial pointscope
- whether the query matches the document content or propertiesoptions
- options for fine tuning the queryweight
- the multiplier for the match in the document rankingregions
- the possible regions containing the pointpublic StructuredQueryDefinition geospatial(StructuredQueryBuilder.GeospatialRegionIndex index, StructuredQueryBuilder.GeospatialOperator operator, StructuredQueryBuilder.Region... regions)
index
- the container for the geospatial regionsoperator
- the geospatial operator to be applied with the regions in the
index and the specified regionsregions
- the possible regions containing the regionpublic StructuredQueryDefinition geospatial(StructuredQueryBuilder.GeospatialRegionIndex index, StructuredQueryBuilder.GeospatialOperator operator, StructuredQueryBuilder.FragmentScope scope, java.lang.String[] options, StructuredQueryBuilder.Region... regions)
index
- the container for the geospatial regionsoperator
- the geospatial operator to be applied with the regions in the
index and the specified regionsscope
- whether the query matches the document content or propertiesoptions
- options for fine tuning the queryregions
- the possible regions containing the regionpublic StructuredQueryDefinition geospatial(StructuredQueryBuilder.GeospatialRegionIndex index, StructuredQueryBuilder.GeospatialOperator operator, StructuredQueryBuilder.FragmentScope scope, java.lang.String[] options, java.lang.Double weight, StructuredQueryBuilder.Region... regions)
index
- the container for the geospatial regionsoperator
- the geospatial operator to be applied with the regions in the
index and the specified regionsscope
- whether the query matches the document content or propertiesoptions
- options for fine tuning the queryweight
- the multiplier for the match in the document rankingregions
- the possible regions containing the regionpublic StructuredQueryBuilder.Element element(javax.xml.namespace.QName qname)
qname
- the name of the elementpublic StructuredQueryBuilder.Element element(java.lang.String name)
name
- the name of the elementpublic StructuredQueryBuilder.Attribute attribute(javax.xml.namespace.QName qname)
qname
- the name of the attributepublic StructuredQueryBuilder.Attribute attribute(java.lang.String name)
name
- the name of the attributepublic StructuredQueryBuilder.ElementAttribute elementAttribute(StructuredQueryBuilder.Element element, StructuredQueryBuilder.Attribute attribute)
element
- the element identifierattribute
- the attribute identifierpublic StructuredQueryBuilder.Field field(java.lang.String name)
name
- the name of the fieldpublic StructuredQueryBuilder.JSONProperty jsonProperty(java.lang.String name)
name
- the name of the JSON propertypublic StructuredQueryBuilder.PathIndex pathIndex(java.lang.String path)
path
- the indexed pathpublic StructuredQueryBuilder.GeospatialIndex geoJSONProperty(StructuredQueryBuilder.JSONProperty jsonProperty)
jsonProperty
- the json property containing the geospatial coordinatespublic StructuredQueryBuilder.GeospatialIndex geoJSONProperty(StructuredQueryBuilder.JSONProperty parent, StructuredQueryBuilder.JSONProperty jsonProperty)
parent
- the parent of the json property with the coordinatesjsonProperty
- the json property containing the geospatial coordinatespublic StructuredQueryBuilder.GeospatialIndex geoJSONPropertyPair(StructuredQueryBuilder.JSONProperty parent, StructuredQueryBuilder.JSONProperty lat, StructuredQueryBuilder.JSONProperty lon)
parent
- the parent json property of lat and lonlat
- the json property with the latitude coordinatelon
- the json property with the longitude coordinatepublic StructuredQueryBuilder.GeospatialIndex geoElement(StructuredQueryBuilder.Element element)
element
- the element containing the geospatial coordinatespublic StructuredQueryBuilder.GeospatialIndex geoElement(StructuredQueryBuilder.Element parent, StructuredQueryBuilder.Element element)
parent
- the parent of the element with the coordinateselement
- the element containing the geospatial coordinatespublic StructuredQueryBuilder.GeospatialIndex geoElementPair(StructuredQueryBuilder.Element parent, StructuredQueryBuilder.Element lat, StructuredQueryBuilder.Element lon)
parent
- the parent of the element with the coordinateslat
- the element with the latitude coordinatelon
- the element with the longitude coordinatepublic StructuredQueryBuilder.GeospatialIndex geoAttributePair(StructuredQueryBuilder.Element parent, StructuredQueryBuilder.Attribute lat, StructuredQueryBuilder.Attribute lon)
parent
- the parent of the element with the coordinateslat
- the attribute with the latitude coordinatelon
- the attribute with the longitude coordinatepublic StructuredQueryBuilder.GeospatialIndex geoPath(StructuredQueryBuilder.PathIndex pathIndex)
pathIndex
- the indexed pathpublic StructuredQueryBuilder.GeospatialRegionIndex geoRegionPath(StructuredQueryBuilder.PathIndex pathIndex)
pathIndex
- the indexed pathpublic StructuredQueryBuilder.GeospatialRegionIndex geoRegionPath(StructuredQueryBuilder.PathIndex pathIndex, StructuredQueryBuilder.CoordinateSystem coordinateSystem)
pathIndex
- the indexed pathcoordinateSystem
- the coordinate system used along with precision info
used for the indexpublic StructuredQueryBuilder.Point point(double latitude, double longitude)
latitude
- the latitude coordinatelongitude
- the longitude coordinatepublic StructuredQueryBuilder.Circle circle(double latitude, double longitude, double radius)
latitude
- the latitude coordinate of the centerlongitude
- the longitude coordinate of the centerradius
- the radius of the circlepublic StructuredQueryBuilder.Circle circle(StructuredQueryBuilder.Point center, double radius)
center
- the point defining the centerradius
- the radius of the circlepublic StructuredQueryBuilder.Box box(double south, double west, double north, double east)
south
- the latitude of the south coordinatewest
- the longitude of the west coordinatenorth
- the latitude of the north coordinateeast
- the longitude of the east coordinatepublic StructuredQueryBuilder.Polygon polygon(StructuredQueryBuilder.Point... points)
points
- the list of points defining the perimeter of the regionpublic StructuredQueryDefinition containerConstraint(java.lang.String constraintName, StructuredQueryDefinition query)
constraintName
- the constraint definitionquery
- the query definitionpublic StructuredQueryDefinition propertiesConstraint(java.lang.String constraintName, StructuredQueryDefinition query)
constraintName
- the constraint definitionquery
- the query definitionpublic StructuredQueryDefinition collectionConstraint(java.lang.String constraintName, java.lang.String... uris)
constraintName
- the constraint definitionuris
- the identifiers for the criteria collectionspublic StructuredQueryDefinition valueConstraint(java.lang.String constraintName, java.lang.String... values)
constraintName
- the constraint definitionvalues
- the possible values to matchpublic StructuredQueryDefinition valueConstraint(java.lang.String constraintName, double weight, java.lang.String... values)
constraintName
- the constraint definitionweight
- the multiplier for the match in the document rankingvalues
- the possible values to matchpublic StructuredQueryDefinition wordConstraint(java.lang.String constraintName, java.lang.String... words)
constraintName
- the constraint definitionwords
- the possible words to matchpublic StructuredQueryDefinition wordConstraint(java.lang.String constraintName, double weight, java.lang.String... words)
constraintName
- the constraint definitionweight
- the multiplier for the match in the document rankingwords
- the possible words to matchpublic StructuredQueryDefinition rangeConstraint(java.lang.String constraintName, StructuredQueryBuilder.Operator operator, java.lang.String... values)
constraintName
- the constraint definitionoperator
- the comparison with the criteria valuesvalues
- the possible datatyped values for the comparisonpublic StructuredQueryBuilder.GeospatialConstraintQuery geospatialConstraint(java.lang.String constraintName, StructuredQueryBuilder.Region... regions)
constraintName
- the constraint definitionregions
- the possible regions containing the pointpublic StructuredQueryDefinition geospatialRegionConstraint(java.lang.String constraintName, StructuredQueryBuilder.GeospatialOperator operator, StructuredQueryBuilder.Region... regions)
constraintName
- the constraint definitionoperator
- the geospatial operator to be applied with the regions
in the index and the criteria regionsregions
- the possible regions containing the pointpublic StructuredQueryDefinition customConstraint(java.lang.String constraintName, java.lang.String... text)
constraintName
- the constraint definitiontext
- the input to the custom querypublic java.lang.String[] rangeOptions(java.lang.String... options)
options
- the list of range query optionspublic StructuredQueryDefinition boost(StructuredQueryDefinition matchingQuery, StructuredQueryDefinition boostingQuery)
matchingQuery
- the query definition that filters documentsboostingQuery
- the query definition that increases the rank for some filtered documentspublic StructuredQueryDefinition notIn(StructuredQueryDefinition positive, StructuredQueryDefinition negative)
positive
- the query definition that includes documentsnegative
- the query definition that excludes documentspublic IterableNamespaceContext getNamespaces()
public void setNamespaces(IterableNamespaceContext namespaces)
EditableNamespaceContext
class to instantiate a set of bindings between namespace prefixes and Uris.namespaces
- the namespace bindingspublic StructuredQueryBuilder.Axis axis(java.lang.String name)
temporalPeriodRange
or temporalPeriodCompare
queries.name
- the name of the axis as configured in the serverpublic StructuredQueryBuilder.Period period(java.util.Calendar start, java.util.Calendar end)
temporalPeriodRange
queries.start
- the start date/time for this periodend
- the end date/time for this periodpublic StructuredQueryBuilder.Period period(java.lang.String start, java.lang.String end)
temporalPeriodRange
queries.start
- the start date/time for this period, in ISO 8601 formatend
- the end date/time for this period, in ISO 8601 formatpublic StructuredQueryDefinition temporalPeriodRange(StructuredQueryBuilder.Axis axis, StructuredQueryBuilder.TemporalOperator operator, StructuredQueryBuilder.Period period, java.lang.String... options)
axis
- the axis of document temporal values used to determine which documents have
values that match this queryoperator
- the operator used to determine if values in the axis match the specified periodperiod
- the period considered using the operatoroptions
- string options from the list for
cts:period-range-query callspublic StructuredQueryDefinition temporalPeriodRange(StructuredQueryBuilder.Axis[] axes, StructuredQueryBuilder.TemporalOperator operator, StructuredQueryBuilder.Period[] periods, java.lang.String... options)
axes
- the set of axes of document temporal values used to determine which documents have
values that match this queryoperator
- the operator used to determine if values in the axis match the specified periodperiods
- the periods considered using the operator. When multiple periods are specified,
the query matches if a value matches any period.options
- string options from the list for
cts:period-range-query callspublic StructuredQueryDefinition temporalPeriodCompare(StructuredQueryBuilder.Axis axis1, StructuredQueryBuilder.TemporalOperator operator, StructuredQueryBuilder.Axis axis2, java.lang.String... options)
axis1
- the first axis of document temporal values
values that match this queryoperator
- the operator used to determine if values in the axis match the specified periodaxis2
- the second axis of document temporal valuesoptions
- string options from the list for
cts:period-compare-query callspublic StructuredQueryDefinition temporalLsqtQuery(java.lang.String temporalCollection, java.util.Calendar time, double weight, java.lang.String... options)
temporalCollection
- the temporal collection to querytime
- documents with lsqt equal to or prior to this timestamp will matchweight
- the weight for this queryoptions
- string options from the list for
cts:lsqt-query callspublic StructuredQueryDefinition temporalLsqtQuery(java.lang.String temporalCollection, java.lang.String timestamp, double weight, java.lang.String... options)
temporalCollection
- the temporal collection to querytimestamp
- timestamp in ISO 8601 format - documents with lsqt equal to or
prior to this timestamp will matchweight
- the weight for this queryoptions
- string options from the list for
cts:lsqt-query callspublic StructuredQueryDefinition beforeQuery(long timestamp)
timestamp
- time in ISO 8601 format - documents with timestamp equal to or
prior to this timestamp will matchpublic StructuredQueryDefinition afterQuery(long timestamp)
timestamp
- time in ISO 8601 format - documents with timestamp after this time will match.Copyright © 2013-2020 MarkLogic Corporation.