term-level-queries

term-level-queries

Methods

# (static) rangeQuery(params) → {Object}

Assemble a rangeQuery fragment
Parameters:
Name Type Description
params Object
Properties
Name Type Description
field string the name of the field to perform the query against. Can be a dotted path like: publisher.name
parmas.value array an array of bounds - [ min, max ]
Returns:
a query fragment
Type
Object
Example
rangeQuery({ field: 'date', value: [ min, max] })

# (static) termQuery(params) → {Object}

Assemble a termQuery fragment. Use this when you want to match a term exactly - normally this is used on a keyword mapping.
Parameters:
Name Type Description
params Object
Properties
Name Type Description
field string the name of the field to perform the query against. Can be a dotted path like: publisher.name
value string the value to look for
Returns:
a query fragment
Type
Object
Example
termQuery({ field: 'name.keyword', value: 'some text' })

# (static) wildcardQuery(params) → {Object}

Assemble a wildcardQuery fragment
Parameters:
Name Type Description
params Object
Properties
Name Type Description
field string the name of the field to perform the query against. Can be a dotted path like: publisher.name
value string the value to look for
Returns:
a query fragment
Type
Object
Example
wildcardQuery({ field: 'name.keyword', value: 'some text' })