Module
Request
Request ( conf )
Provides methods for generating request bodies.
|
Properties
Name | Description |
---|---|
query <Object> |
The internal query object. |
Method Summary
Returns | Name | Description |
---|---|---|
String | _type() | The type of ejs object. For internal use only. |
Object | agg(agg) | Add an aggregation. This method can be called multiple times in order to set multiple nested aggregations that will be executed at the same time as the search request. Alias for the aggregation method. |
Object | aggregation(agg) | Add an aggregation. This method can be called multiple times in order to set multiple nested aggregations that will be executed at the same time as the search request. |
Object | explain(trueFalse) | Enable/Disable explanation of score for each search result. |
Object | facet(facet) | Allows you to set the specified facet on this request object. Multiple facets can be set, all of which will be returned when the search is executed. |
Object | fields(s) | By default, searches return full documents, meaning every property or field. This method allows you to specify which fields you want returned. Pass a single field name and it is appended to the current list of fields. Pass an array of fields and it replaces all existing fields. |
Object | filter(filter) | Allows you to set a specified filter on this request object. |
Object | from(f) | A search result set could be very large (think Google). Setting the
from parameter allows you to page through the result set
by making multiple request. This parameters specifies the starting
result/document number point. Combine with size() to achieve paging. |
Object | highlight(h) | Performs highlighting based on the Highlight
settings. |
Object | indexBoost(index,boost) | Boosts hits in the specified index by the given boost value. |
Object | minScore(min) | Filters out search results will scores less than the specified minimum score. |
Object | partialField(oPartialField) | Control what part of the _source will be loaded based on PartialField . |
Object | post_filter(filter) | Allows you to set a specified post_filter on this request object. |
Object | query(someQuery) | Allows you to set the specified query on this search object. This is the query that will be used when the search is executed. |
Object | rescore(r) | Once a query executes, you can use rescore to run a secondary, more expensive query to re-order the results. |
Object | scriptField(oScriptField) | Computes a document property dynamically based on the supplied ScriptField . |
Object | size(s) | Sets the number of results/documents to be returned. This is set on a per page basis. |
Object | sort(fieldName) | Sets the sorting for the query. This accepts many input formats.
Multi-level sorting is supported so the order in which sort fields are added to the query requests is relevant. It is recommended to use |
Object | source(includes,excludes) | Allows to control how the _source field is returned with every hit. By default operations return the contents of the _source field unless you have used the fields parameter or if the _source field is disabled. Set the includes parameter to false to completely disable returning the source field. |
Object | suggest(s) | Allows you to set the specified suggester on this request object.
Multiple suggesters can be set, all of which will be returned when
the search is executed. Global suggestion text can be set by
passing in a string vs. a Suggest object. |
Object | timeout(t) | A timeout, bounding the request to be executed within the
specified time value and bail when expired. Defaults to no timeout.
This option is valid during the following operations:
|
String | toJSON() | Retrieves the internal query object. This is typically used by
internal API functions so use with caution. |
Object | trackScores(trueFalse) | Enables score computation and tracking during sorting. Be default, when sorting scores are not computed. |
Object | version(trueFalse) | Enable/Disable returning version number for each search result. |
Method Detail
agg
Object agg ( agg )
Add an aggregation. This method can be called multiple times
in order to set multiple nested aggregations that will be executed
at the same time as the search request. Alias for the aggregation method.
|
aggregation
Object aggregation ( agg )
Add an aggregation. This method can be called multiple times
in order to set multiple nested aggregations that will be executed
at the same time as the search request.
|
explain
Object explain ( trueFalse )
Enable/Disable explanation of score for each search result.
|
facet
Object facet ( facet )
Allows you to set the specified facet on this request object. Multiple facets can
be set, all of which will be returned when the search is executed.
|
fields
Object fields ( s )
By default, searches return full documents, meaning every property or field.
This method allows you to specify which fields you want returned.
Pass a single field name and it is appended to the current list of
fields. Pass an array of fields and it replaces all existing
fields.
|
filter
Object filter ( filter )
Allows you to set a specified filter on this request object.
|
from
Object from ( f )
A search result set could be very large (think Google). Setting the
from parameter allows you to page through the result set
by making multiple request. This parameters specifies the starting
result/document number point. Combine with size() to achieve paging.
|
highlight
Object highlight ( h )
Performs highlighting based on the Highlight
settings.
|
indexBoost
Object indexBoost ( index, boost )
Boosts hits in the specified index by the given boost value.
|
minScore
Object minScore ( min )
Filters out search results will scores less than the specified minimum score.
|
partialField
Object partialField ( oPartialField )
Control what part of the _source will be loaded based on PartialField .
|
post_filter
Object post_filter ( filter )
Allows you to set a specified post_filter on this request object.
|
query
Object query ( someQuery )
Allows you to set the specified query on this search object. This is the
query that will be used when the search is executed.
|
rescore
Object rescore ( r )
Once a query executes, you can use rescore to run a secondary, more
expensive query to re-order the results.
|
scriptField
Object scriptField ( oScriptField )
Computes a document property dynamically based on the supplied ScriptField .
|
size
Object size ( s )
Sets the number of results/documents to be returned. This is set on a per page basis.
|
sort
Object sort ( fieldName )
Sets the sorting for the query. This accepts many input formats.
Multi-level sorting is supported so the order in which sort fields are added to the query requests is relevant. It is recommended to use
|
source
Object source ( includes, excludes )
Allows to control how the _source field is returned with every hit.
By default operations return the contents of the _source field
unless you have used the fields parameter or if the _source field
is disabled. Set the includes parameter to false to completely
disable returning the source field.
|
suggest
Object suggest ( s )
Allows you to set the specified suggester on this request object.
Multiple suggesters can be set, all of which will be returned when
the search is executed. Global suggestion text can be set by
passing in a string vs. a Suggest object.
|
timeout
Object timeout ( t )
A timeout, bounding the request to be executed within the
specified time value and bail when expired. Defaults to no timeout.
This option is valid during the following operations:
|
toJSON
String toJSON ( )
Retrieves the internal query object. This is typically used by
internal API functions so use with caution.
|
trackScores
Object trackScores ( trueFalse )
Enables score computation and tracking during sorting. Be default,
when sorting scores are not computed.
|
version
Object version ( trueFalse )
Enable/Disable returning version number for each search result.
|