lucee.Componentcbelasticsearch.SearchBuilder
Elasticsearch Search Builder Object
Property Summary | ||||
---|---|---|---|---|
type | property | default | serializable | required |
any
|
aggregations
Property containing the struct representation of any query aggregations.
|
true
|
false
|
|
any
|
configObject
|
true
|
false
|
|
any
|
highlight
Property containing the struct representation of highlight.
|
true
|
false
|
|
any
|
id
Property containing a document `_id`.
|
true
|
false
|
|
any
|
index
Property containing the index name of the active builder search.
|
true
|
false
|
|
any
|
matchType
When performing matching searches, the type of match to specify.
|
true
|
false
|
|
any
|
maxRows
|
true
|
false
|
|
boolean
|
preflight
Whether to preflight the query prior to execution( recommended ) - ensures consistent formatting to prevent errors.
|
true
|
false
|
|
any
|
query
Property containing the struct representation of the query being built.
|
true
|
false
|
|
any
|
script
Property containing an elasticsearch scripting dsl string.
|
true
|
false
|
|
any
|
sorting
Property containing an array of sort commands.
|
true
|
false
|
|
any
|
source
Property containing the struct representation of any _source properties.
|
true
|
false
|
|
any
|
startRow
|
true
|
false
|
|
any
|
type
Property containing the object type within the index.
|
true
|
false
|
Method Summary | |
---|---|
SearchBuilder
|
aggregation(string name, struct options)
Adds an aggregation directive to the search parameters. |
any
|
count()
Counts the results of the currently built search. |
SearchBuilder
|
dateMatch(string name, [string start], [string end], [numeric boost])
`range` match for dates. |
any
|
deleteAll()
Deletes all documents matching the currently build search query. |
SearchBuilder
|
disjunction(struct matches, [numeric tieBreaker])
Performs a disjunctive search ( https://www. |
any
|
execute()
Persists the document to Elasticsearch. |
any
|
filterTerm(string name, any value)
|
any
|
filterTerms(string name, any value)
|
string
|
getAggregations()
|
Client
|
getClient()
Client provider. |
string
|
getConfigObject()
|
struct
|
getDSL()
|
string
|
getHighlight()
|
string
|
getId()
|
string
|
getIndex()
|
string
|
getJSON()
|
string
|
getMatchType()
|
string
|
getMaxRows()
|
string
|
getPreflight()
|
string
|
getQuery()
|
string
|
getScript()
|
string
|
getSorting()
|
string
|
getSource()
|
string
|
getStartRow()
|
string
|
getType()
|
SearchBuilder
|
highLight(any highlight)
Adds highlighting to search. |
SearchBuilder
|
match(any name, any value, [numeric boost], [struct options], [string matchType='any'], [string type='best_fields'], [string minimumShouldMatch])
Applies a match requirement to the search builder query. |
SearchBuilder
|
multiMatch(array names, any value, [numeric boost], [string type='best_fields'])
'multi_match' query alias for match(). |
SearchBuilder
|
mustExist(string name)
Assigns a key which must exists to the query. |
SearchBuilder
|
mustMatch(string name, any value, [numeric boost])
`must` query alias for match(). |
SearchBuilder
|
mustNotExist(string name)
Assigns a key which must not exist to the query. |
SearchBuilder
|
mustNotMatch(string name, any value, [numeric boost])
`must_not` query alias for match(). |
SearchBuilder
|
new([string index], [string type], [struct properties])
Populates a new SearchBuilder object. |
any
|
onDIComplete()
|
void
|
preflightQuery()
Performs a preflight on the search. |
any
|
reset()
|
any
|
setAggregations(any aggregations)
|
any
|
setConfigObject(any configObject)
|
any
|
setHighlight(any highlight)
|
any
|
setId(any id)
|
any
|
setIndex(any index)
|
any
|
setMatchType(any matchType)
|
any
|
setMaxRows(any maxRows)
|
any
|
setPreflight(boolean preflight)
|
any
|
setQuery(any query)
|
any
|
setScript(any script)
|
any
|
setSorting(any sorting)
|
any
|
setSource([struct source='[runtime expression]'])
|
any
|
setSourceExcludes([array excludes='[runtime expression]'])
|
any
|
setSourceIncludes([array includes='[runtime expression]'])
|
any
|
setStartRow(any startRow)
|
any
|
setType(any type)
|
SearchBuilder
|
shouldMatch(string name, any value, [numeric boost])
`must` query alias for match(). |
SearchBuilder
|
sort(any sort, [any sortConfig])
Applies a custom sort to the search query. |
SearchBuilder
|
term(string name, any value, [numeric boost])
Adds an exact value restriction ( elasticsearch: term ) to the query. |
SearchBuilder
|
terms(string name, any value, [numeric boost])
Adds an exact value restriction ( elasticsearch: term ) to the query. |
Methods inherited from class lucee.Component |
---|
None |
Property Detail |
---|
Property containing the struct representation of any query aggregations
access
- publicrequired
- falsereturntype
- anyserializable
- trueaccess
- publicrequired
- falsereturntype
- anyinject
- Config@cbElasticsearchserializable
- trueProperty containing the struct representation of highlight
access
- publicrequired
- falsereturntype
- anyserializable
- trueProperty containing a document `_id`
access
- publicrequired
- falsereturntype
- anyserializable
- trueProperty containing the index name of the active builder search
access
- publicrequired
- falsereturntype
- anyserializable
- trueWhen performing matching searches, the type of match to specify
access
- publicrequired
- falsereturntype
- anyserializable
- trueaccess
- publicrequired
- falsereturntype
- anyserializable
- trueWhether to preflight the query prior to execution( recommended ) - ensures consistent formatting to prevent errors
access
- publicrequired
- falsereturntype
- anyserializable
- trueProperty containing the struct representation of the query being built
access
- publicrequired
- falsereturntype
- anyserializable
- trueProperty containing an elasticsearch scripting dsl string
access
- publicrequired
- falsereturntype
- anyserializable
- trueProperty containing an array of sort commands
access
- publicrequired
- falsereturntype
- anyserializable
- trueProperty containing the struct representation of any _source properties
access
- publicrequired
- falsereturntype
- anyserializable
- trueaccess
- publicrequired
- falsereturntype
- anyserializable
- trueProperty containing the object type within the index
access
- publicrequired
- falsereturntype
- anyserializable
- trueMethod Detail |
---|
Adds an aggregation directive to the search parameters https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations.html
name
- string the key of the aggregationoptions
- struct the elasticsearch aggregation DSL structCounts the results of the currently built search
`range` match for dates
name
- string the key to matchstart
- string the preformatted date string to start the rangeend
- string the preformatted date string to end the rangeboost
- numeric the boost value of the matchDeletes all documents matching the currently build search query
Performs a disjunctive search ( https://www.elastic.co/guide/en/elasticsearch/guide/current/_tuning_best_fields_queries.html )
matches
- struct A struct containing the matchestieBreaker
Persists the document to Elasticsearch
name
value
name
value
Client provider
Adds highlighting to search https://www.elastic.co/guide/en/elasticsearch/reference/6.7/search-request-highlighting.html
highlight
- struct the elasticsearch highlight DSL structApplies a match requirement to the search builder query https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-match-query.html pass in to the match parameters ( e.g. - operator, zero_terms_query, etc ) Valid options: - "any" - "all" - "phrase" - requires an exact match of a given phrase - "must" | "must_not" - specifies that any document returned must or must not match - "should" - specifies that any documents returned should match the value(s) provided
name
- string|array the name of the key to searchvalue
- string the value of the keyboost
- numeric A numeric boost option for any exact matchesoptions
- struct An additional struct map of Elasticsearch query options tomatchType
- string a match type ( default="any" )type
minimumShouldMatch
'multi_match' query alias for match()
names
- array an array of keys to searchvalue
- string the value of the keyboost
- numeric an optional boost valuetype
Assigns a key which must exists to the query
name
- string the name of the key to search`must` query alias for match()
name
- string the name of the key to searchvalue
- string the value of the keyboost
Assigns a key which must not exist to the query
name
- string the name of the key to search`must_not` query alias for match()
name
- string the name of the key to searchvalue
- string the value of the keyboost
Populates a new SearchBuilder object
index
- string the name of the index to searchtype
- string the index type identifierproperties
- struct a struct representation of the searchPerforms a preflight on the search ensures that a dynamically assembled query is well formatted before being passed on to elasticsearch
aggregations
configObject
highlight
id
index
matchType
maxRows
preflight
query
script
sorting
source
excludes
includes
startRow
type
`must` query alias for match()
name
- string the name of the key to searchvalue
- string the value of the keyboost
Applies a custom sort to the search query may also accept a full struct representation, which will be appended to the custom sort
sort
- any If passed as a string, the sortConfig argument is required,sortConfig
- string A configuration - either a string or a full es-compatible sort configuration structAdds an exact value restriction ( elasticsearch: term ) to the query
name
- string the name of the parameter to matchvalue
- any the value of the parameter to matchboost
- numeric A numeric boost option for any exact matchesAdds an exact value restriction ( elasticsearch: term ) to the query
name
- string the name of the parameter to matchvalue
- any the value of the parameter to matchboost
- numeric A numeric boost option for any exact matches