Skip to content

REST API

AndClause

Matches documents where all child clauses match.

Example

{
"type": "and",
"clauses": [
{
"field": "category",
"match": {
"value": "fiction"
}
},
{
"field": "published",
"match": {
"value": true
}
}
]
}

Properties

typestringrequired
Selects the clause type.
Values
"and"
clausesClause[]required
Child clauses, all of which must match.
Example
{
"field": "category",
"match": {
"value": "fiction"
}
}
9 types
FieldClausetype: "field"
Matches documents by the value of a single field. The targeted field must be indexed for the requested matcher usage; if it is not configured for that usage, the request returns search:usage_unsupported.
Example
{
"field": "category",
"match": {
"value": "fiction"
}
}
fieldstringrequired
Target field, as named in the index definition.
Example
"category"
matchMatcherrequired
Criteria evaluated against the field's values.
Example
{
"value": "fiction"
}
9 types
EqualsMatchertype: "equals"
Matches field values equal to value.
Example
{
"value": "fiction"
}
valueanyrequired
The value that the field value must equal.
Example
"fiction"
InMatchertype: "in"
Matches field values equal to any value in values. An empty array matches no documents.
Example
{
"type": "in",
"values": [
"fiction",
"poetry"
]
}
valuesany[]required
The values that a field value may equal.
AnyMatchertype: "any"
Matches any document that contains a value for the field.
Example
{
"type": "any"
}
PrefixMatchertype: "prefix"
Matches string field values starting with value, evaluated against the entire field value.
Example
{
"type": "prefix",
"value": "EX-"
}
valuestringrequired
The prefix that a field value must start with.
Example
"EX-"
UnderMatchertype: "under"
Matches values at or below the specified path in a hierarchical tree. Requires a field configured with hierarchy. Path segments must match complete levels, so Men/Sho matches nothing where a prefix matcher matches.
Example
{
"type": "under",
"path": "Men/Shoes"
}
pathstringrequired
Path in the hierarchical tree to match at or below.
Example
"Men/Shoes"
RangeMatchertype: "range"
Matches values within bounds. Accepts inclusive (gte, lte) and exclusive (gt, lt) bounds; either side may be left open, and at least one bound is required (search:matcher:range_empty).
Example
{
"type": "range",
"gte": 10,
"lt": 20
}
gteany
Lower bound, the value itself included.
Example
10
gtany
Lower bound, the value itself excluded.
lteany
Upper bound, the value itself included.
ltany
Upper bound, exclusive.
Example
20
RangesMatchertype: "ranges"
Matches values falling within any of the specified range objects. An empty array matches no documents, matching the behavior of an empty in matcher.
Example
{
"type": "ranges",
"values": [
{
"gte": 10,
"lt": 20
},
{
"gte": 50
}
]
}
valuesMatcherRange[]required
The ranges to evaluate, each requiring at least one bound. A bucket returned by a range facet sets from as gte and to as lt.
Example
{
"gte": 10,
"lt": 20
}
4 properties
gteany
Lower bound, the value itself included.
Example
10
gtany
Lower bound, the value itself excluded.
lteany
Upper bound, the value itself included.
ltany
Upper bound, exclusive.
Example
20
TextMatchertype: "text"
Matches text within a single field using field-level analysis.
Example
{
"type": "text",
"text": "silent spring",
"match": "phrase"
}
textstringrequired
The query text to match.
matchMatch
Term matching mode. phrase requires terms to appear in exact order and adjacent; user parses search syntax such as quotes and negation.
Default
"all"
Values
"all", "any", "phrase", "user"
joinJoin
How the parts of user text combine: all requires every word and every quoted phrase, any accepts a document that holds one of them. Excluded terms (-word) always apply. Setting join with any other match returns search:clause:join_unsupported.
Default
"all"
Values
"all", "any"
prefixPrefix
Prefix matching behavior on the final query term. last_token matches the trailing word as a prefix; off requires an exact word match.
Default
"last_token"
Values
"last_token", "off"
Typo tolerance handling. auto follows the field's typoTolerance configuration; off disables typo tolerance for the matcher.
Default
"auto"
Values
"auto", "off"
slopinteger
Number of intervening words permitted between terms in a phrase, without changing their relative order. Only applies to phrase queries or quoted phrases in user mode.
Default
0
Format
int32
relaxRelax
Query relaxation strategy applied only when the query returns zero matches. See Finding something rather than nothing.
Default
"unmatched"
Values
"off", "unmatched", "words"
interpretInterpretMode
Whether parts of user text are read as filters on the fields of the index: auto reads a number typed next to the unit of a number field, or next to a comparative word such as under, as a filter on that field; off takes every word as text. Whatever was read is reported as interpreted beside the results. See Reading numbers and units.
Default
"auto"
Values
"auto", "off"
DistanceMatchertype: "distance"
Matches geopoint values within radius meters of the specified latitude and longitude coordinates.
Example
{
"type": "distance",
"lat": 59.3,
"lon": 18.1,
"radius": 5000
}
latnumberrequired
Latitude of the origin, in degrees.
Format
double
Range
-90 to 90
Example
59.3
lonnumberrequired
Longitude of the origin, in degrees.
Format
double
Range
-180 to 180
Example
18.1
radiusnumberrequired
Maximum distance from the origin in meters.
Format
double
Example
5000
TextClausetype: "text"
Matches query text across one or more fields. Phrase queries operate within a single field and match terms exactly as typed, regardless of field typoTolerance. Fields defined only for autocomplete do not support phrase matching. See text.
Example
{
"type": "text",
"text": "silent spr",
"fields": {
"name": 3,
"description": null
}
}
textstringrequired
The query text to match.
Example
"silent spr"
fieldsmap of number
Object mapping field names to score weights. A field mapped to null uses the weight from its field definition. If omitted, searches all searchable fields, skipping autocomplete-only fields.
1 property
<key>number
Format
float
matchMatch
Term matching mode. phrase requires terms to appear in exact order and adjacent; user parses search syntax such as quotes and negation.
Default
"all"
Values
"all", "any", "phrase", "user"
joinJoin
How the parts of user text combine: all requires every word and every quoted phrase, any accepts a document that holds one of them. Excluded terms (-word) always apply, and a filter read out of the text is one of the parts. Setting join with any other match returns search:clause:join_unsupported. See Reading what was typed.
Default
"all"
Values
"all", "any"
prefixPrefix
Prefix matching behavior on the final query term. last_token matches the trailing word as a prefix; off requires an exact word match.
Default
"last_token"
Values
"last_token", "off"
Typo tolerance handling. auto follows each field's typoTolerance configuration; off disables typo tolerance for the clause.
Default
"auto"
Values
"auto", "off"
slopinteger
Number of intervening words permitted between terms in a phrase, without changing their relative order. Setting slop above 0 with "match": "all" or "match": "any" returns search:clause:slop_unsupported.
Default
0
Format
int32
relaxRelax
Query relaxation strategy applied only when the query returns zero matches. See Finding something rather than nothing.
Default
"unmatched"
Values
"off", "unmatched", "words"
combineCombine
Scope for multi-field term matching. term evaluates each term across all targeted fields, so terms may appear in different fields; field requires a single field to satisfy match on its own. Ignored by phrase queries.
Default
"term"
Values
"term", "field"
interpretInterpret
Whether parts of user text are read as filters on the fields of the index, given as a mode or as the targets to read on. See Reading numbers and units.
Default
"auto"
2 types
Whether parts of user text are read as filters: auto reads a number typed next to a unit or a comparative word as a filter on the field declaring that unit, off takes every word as text.
Reads user text as filters on the named targets only. A number typed with a unit is read on every target declaring that unit; a number typed without one is read on every target holding a currency, when they all hold the same currency.
Example
{
"fields": [
{
"field": "prices.amount"
}
]
}
fieldsInterpretTarget[]required
The targets a reading may be a filter on. At least one is required.
Example
{
"field": "prices.amount",
"when": [
{
"field": "prices.list",
"match": {
"value": "customer"
}
}
],
"fallback": [
{
"field": "prices.amount",
"when": [
{
"field": "prices.list",
"match": {
"value": "store"
}
}
]
}
]
}
3 properties
fieldstringrequired
The field, as named in the index definition.
Example
"prices.amount"
Clauses that must hold where the number is read: in the same value as the field for a field inside a nested list, and for the document otherwise. Takes what a nested clause takes: field, text, and, or, not and boost. A clause naming a field outside the list returns search:nested:field_not_inside.
Example
{
"field": "category",
"match": {
"value": "fiction"
}
}
Targets read instead, in order, where the document holds no value on this one - a product with no price on the customer's list is read on the store's list. Every target of the chain must declare the same unit; one in another unit returns search:interpret:fallback_unit_mismatch.
Example
{
"field": "prices.amount",
"when": [
{
"field": "prices.list",
"match": {
"value": "customer"
}
}
],
"fallback": [
{
"field": "prices.amount",
"when": [
{
"field": "prices.list",
"match": {
"value": "store"
}
}
]
}
]
}
KnnClausetype: "knn"
Matches the k nearest documents by vector distance in a specified field, scored by proximity. Cannot be combined with hits (search:hits:knn_unsupported).
Example
{
"type": "knn",
"field": "embedding",
"vector": [
0.1,
0.2
],
"k": 10,
"filter": [
{
"field": "published",
"match": {
"value": true
}
}
]
}
fieldstringrequired
The vector field to search.
Example
"embedding"
vectornumber[]required
The query vector. Its length must match the dimensions declared in the field definition.
Format
float
kintegerrequired
Number of nearest documents to return, at most EXOFIND_SEARCH_MAX_KNN_K.
Format
int32
filterClause[]
Clauses that documents must satisfy before nearest-neighbor evaluation.
Example
{
"field": "category",
"match": {
"value": "fiction"
}
}
NestedClausetype: "nested"
Matches documents where a single element of a nested object field satisfies all child clauses. A nested clause on a flattened object field returns search:nested:path_not_nested; on a non-object field it returns an error. See nested.
Example
{
"type": "nested",
"path": "variants",
"clauses": [
{
"field": "variants.color",
"match": {
"value": "red"
}
},
{
"field": "variants.price",
"match": {
"type": "range",
"lt": 20
}
}
]
}
pathstringrequired
Name of the nested object field.
Example
"variants"
clausesClause[]
Clauses evaluated within a single nested object value, naming fields by their dotted path. An empty array matches any document where the object field is present. May contain field, text, knn, and, or, not and boost; a clause that only means something for whole documents, such as another nested or a fuse, returns search:nested:clause_unsupported.
Example
{
"field": "category",
"match": {
"value": "fiction"
}
}
scoreScore
Scoring mode for aggregating matching nested values. Only applies when scoring clauses exist within the nested clause.
Default
"max"
Values
"max", "min", "avg", "total"
AndClausetype: "and"
Matches documents where all child clauses match.
Example
{
"type": "and",
"clauses": [
{
"field": "category",
"match": {
"value": "fiction"
}
},
{
"field": "published",
"match": {
"value": true
}
}
]
}
clausesClause[]required
Child clauses, all of which must match.
Example
{
"field": "category",
"match": {
"value": "fiction"
}
}
OrClausetype: "or"
Matches documents where at least one child clause matches.
Example
{
"type": "or",
"clauses": [
{
"field": "category",
"match": {
"value": "fiction"
}
},
{
"field": "category",
"match": {
"value": "poetry"
}
}
]
}
clausesClause[]required
Child clauses, at least one of which must match.
Example
{
"field": "category",
"match": {
"value": "fiction"
}
}
NotClausetype: "not"
Matches documents where no child clause matches.
Example
{
"type": "not",
"clauses": [
{
"field": "discontinued",
"match": {
"value": true
}
}
]
}
clausesClause[]required
Child clauses, none of which may match.
Example
{
"field": "category",
"match": {
"value": "fiction"
}
}
BoostClausetype: "boost"
Increases the relevance score of documents that satisfy child clauses without excluding non-matching documents.
Example
{
"type": "boost",
"weight": 2,
"clauses": [
{
"field": "featured",
"match": {
"value": true
}
}
]
}
weightnumberrequired
Multiplier applied to matching documents. Values greater than 1 increase score; values between 0 and 1 decrease score. Leaving it out, or setting it below 0 or to a non-finite number, returns search:clause:weight_out_of_range.
Format
float
Example
2
clausesClause[]required
Clauses required to apply the boost weight.
Example
{
"field": "category",
"match": {
"value": "fiction"
}
}
FuseClausetype: "fuse"
Matches documents across several rankings, scored and merged by rank. Documents are scored by the sum of weight / (rankConstant + rank) across the rankings that reached them. Because the clause reads only result positions, scores from different scales (such as BM25 text relevance and vector similarity) combine without normalization. Matches at most depth results per ranking. See fuse.
Example
{
"type": "fuse",
"depth": 200,
"rankConstant": 60,
"rankings": [
{
"clauses": [
{
"type": "text",
"text": "waterproof jacket",
"fields": {
"name": null
}
}
]
},
{
"clauses": [
{
"type": "knn",
"field": "embedding",
"vector": [
0.1,
0.2
],
"k": 200
}
],
"weight": 0.5
}
],
"filter": [
{
"field": "inStock",
"match": {
"value": true
}
}
]
}
rankingsFuseRanking[]required
Rankings to run and merge. Specifying fewer than two rankings returns search:clause:rankings_too_few.
Example
{
"clauses": [
{
"type": "text",
"text": "waterproof jacket",
"fields": {
"name": null
}
}
],
"weight": 0.5
}
2 properties
clausesClause[]required
Clauses the ranking searches for, combined with an implicit AND. At least one clause is required.
Example
{
"field": "category",
"match": {
"value": "fiction"
}
}
weightnumber
Multiplier that scales the ranking's contribution relative to other rankings. It cannot reorder results within the ranking.
Default
1
Format
float
depthinteger
Number of results read from each ranking. Pagination cannot exceed the merged list, similar to k in a knn clause. Must be at least 1, and at most EXOFIND_SEARCH_MAX_FUSE_DEPTH.
Default
100
Format
int32
rankConstantnumber
Constant added to each rank before it is inverted. Lower values increase the weight of the highest-ranked results in each ranking; higher values flatten the difference across ranks, giving more weight to documents found by multiple rankings. Must be above 0.
Default
60
Format
float
filterClause[]
Clauses that narrow every ranking before it is cut to depth. A knn clause inside a ranking applies filter entries as a pre-filter, ensuring the vector ranking returns k results. Clauses placed beside the fuse clause filter the merged list after each ranking is cut to depth.
Example
{
"field": "category",
"match": {
"value": "fiction"
}
}

Endpoints

Endpoints where the request or responses uses this type.

Other types

Types that reference this one.

Exofind is built by Level Four AB and is available under the Apache License 2.0.