Query


and

Selects results where both the preceding query expression and the query parameter are true. The segment of a query that this method adds is the same as entering the following string for an Engine query: preceding query expression AND query

Syntax

query and(query/data_method query)
querymodified query

Example

AppBuilder and:
.where(contains("foo").and(contains("bar")))

Example

Engine-equivalent and:
.where("foo AND bar")

or

Selects results where either the preceding query expression or the query parameter is true. The segment of a query that this method adds is the same as entering the following string for an Engine query: preceding query expression OR query

Syntax

query or(query/data_method query)
querymodified query

Example

AppBuilder or:
.where(contains("foo").or(contains("bar")))

Example

Engine-equivalent or:
.where("foo OR bar")

before

Selects results where the preceding query expression exists somewhere before the query parameter. The closer the preceding query expression is to the query parameter, the higher the relevance of the result. The segment of a query that this method adds is the same as entering the following string for an Engine query: preceding query expression BEFORE query

Syntax

query before(query/data_method query)
querymodified query

Example

AppBuilder before:
.where(contains("foo").before(contains("bar")))

Example

Engine-equivalent before:
.where("foo BEFORE bar")

within

Selects results where the preceding query expression exists within the range of the query parameter. The segment of a query that this method adds is the same as entering the following string for an Engine query: preceding query expression WITHIN query If the query parameter is an integer, the segment of a query that this method adds is the same as entering the following string for an Engine query: preceding query expression WITHIN query WORDS

Syntax

query within(query/data_method/int query)
querymodified query

Example

AppBuilder within:
.where(contains("foo").within(contains("bar")))

Example

Engine-equivalent within:
.where("foo WITHIN bar")

Example

AppBuilder within words:
.where(contains("foo").within(5))

Example

Engine-equivalent within:
.where("foo WITHIN 5 WORDS")

not_within

Selects results where the preceding query expression does not exist within the range of the query parameter. The segment of a query that this method adds is the same as entering the following string for an Engine query: preceding query expression NOTWITHIN query

Syntax

query not_within(query/data_method query)
querymodified query

Example

AppBuilder not within:
.where(contains("foo").not_within(contains("bar")))

Example

Engine-equivalent not within:
.where("foo NOTWITHIN bar")

containing

Selects results where the preceding query expression contains the query parameter. Queries that are constructed by using this method produce an index match, not an exact match. The segment of a query that this method adds is the same as entering the following string for an Engine query: CONTENT preceding query expression CONTAINING query

Syntax

query containing(query/data_method query)
querymodified query

Example

AppBuilder containing:
.where(field("foo").containing(contains("bar")))

Example

Engine-equivalent containing:
.where("CONTENT foo CONTAINING bar")

not_containing

Selects results where the preceding query expression does not contain the query parameter. The segment of a query that this method adds is the same as entering the following string for an Engine query: preceding query expression NOTCONTAINING query

Syntax

query not_containing(query/data_method query)
querymodified query

Example

AppBuilder not containing:
.where(field("foo").not_containing(contains("bar")))

Example

Engine-equivalent not containing:
.where("foo NOTCONTAINING bar")

negated

Selects results where the preceding query expression does not exist. The segment of a query that this method adds is the same as entering the following string for an Engine query: -( preceding query expression )

Syntax

query negated
querymodified query

Example

AppBuilder negated:
.where(field("foo").contains("bar").negated)

Example

Engine-equivalent negated:
.where("-(foo:bar)")

near

Selects results where the preceding query expression and the query parameter are within 32 words of each other. This method is equivalent to using the within method and an integer parameter of 32. The segment of a query that this method adds is the same as entering the following string for an Engine query: preceding query expression NEAR query

Syntax

query near(query/data_method query)
querymodified query

Example

AppBuilder near:
.where(contains("foo").near(contains("bar")))

Example

Engine-equivalent near:
.where("foo NEAR bar")

weight

Selects results where the preceding query expression equals the weight parameter. The segment of a query that this method adds is the same as entering the following string for an Engine query: preceding query expression ^ weight

Syntax

query weight(double weight)
querymodified query

Example

AppBuilder weight:
.where(contains("foo").weight(20))

Example

Engine-equivalent weight:
.where("foo^20.0")