summaryrefslogtreecommitdiff
path: root/rest-api-spec/src
AgeCommit message (Collapse)Author
2017-07-04Adds rewrite phase to aggregations (#25495)Colin Goodheart-Smithe
* Adds rewrite phase to aggregations This change adds aggregations to the rewrite performed by the `SearchSourceBuilder`. This means that `AggregationBuilder`s are able to implement a `rewrite()` method where they can return a new `AggregationBuilder` which is functionally the same but in a more primitive form. This is exactly analogous to the rewrite done by the `QueryBuilder`s. The first aggregation to implement the rewrite are the filter and filters aggregations so they can rewrite the filters they contain. Closes #17676 * Removes rewrite from PipelineAggregationBuilder Rewrite is based on shard level information. Since pipeline aggregation are run in the reduce phase it doesn’t make sense to rewrite them on the shards. In fact eventually we shouldn’t be transporting them to the shards at all and should be retaining them on the coordinating node for execution in the reduce phase * Addresses review comments * addresses more review comments * Fixed imports
2017-07-04[Analysis] Support normalizer in request param (#24767)Jun Ohtani
* [Analysis] Support normalizer in request param Support normalizer param Support custom normalizer with char_filter/filter param Closes #23347
2017-06-30Adjust BWC version on bad allocation request testJason Tedor
This commit adjusts the BWC version on the bad cluster allocation explain request test as changing the API to respond with a bad request status instead of an internal server error status was backported to 5.x to be included in 5.6.0. Relates #25503
2017-06-30Adjust status on bad allocation explain requestsJason Tedor
When a user requests a cluster allocation explain in a situation where it does not make sense (for example, there are no unassigned shards), we should consider this a bad request instead of a server error. Yet, today by throwing an illegal state exception, these are treated as server errors. This commit adjusts these so that they throw illegal argument exceptions and are treated as bad requests. Relates #25503
2017-06-30Fix typo in name of testGlen Smith
This commit fixes a typo in the name of a REST test. Relates #25451
2017-06-28Output all empty snapshot info fields if in verbose mode (#25455)Ali Beyad
In #24477, a less verbose option was added to retrieve snapshot info via GET /_snapshot/{repo}/{snapshots}. The point of adding this less verbose option was so that if the repository is a cloud based one, and there are many snapshots for which the snapshot info needed to be retrieved, then each snapshot would require reading a separate snapshot metadata file to pull out the necessary information. This can be costly (performance and cost) on cloud based repositories, so a less verbose option was added that only retrieves very basic information about each snapshot that is all available in the index-N blob - requiring only one read! In order to display this less verbose snapshot info appropriately, logic was added to not display those fields which could not be populated. However, this broke integrators (e.g. ECE) that required these fields to be present, even if empty. This commit is to return these fields in the response, even if empty, if the verbose option is set.
2017-06-28Expand `/_cat/nodes` to return information about hard drive (#21775)Andreas Gebhardt
Expand `/_cat/nodes` with already present information about available disk space `diskAvail` (alias: `d`, `disk`) by: * `diskTotal` (alias `dt`): total disk space * `diskUsed` (alias `du`): used disk space (`diskTotal - diskAvail`) * `diskUsedPercent` (alias `dup`): used disk space percentage Note: The available disk space is the number of bytes available to the node's Java virtual machine. The size might be smaller than the real one. That means the used disk space (percentage) is larger. Closes #21679
2017-06-25Remove remaining `index.mapper.single_type` setting usage from tests (#25388)Simon Willnauer
This change removes the remaining explicitly specified `index.mapper.single_type` settings from tests in order to allow the removal of the setting. This is the already approved part of #25375 broken out to simplfiy reviews on
2017-06-22Enable a long translog retention policy by default (#25294)Boaz Leskes
#25147 added the translog deletion policy but didn't enable it by default. This PR enables a default retention of 512MB (same maximum size of the current translog) and an age of 12 hours (i.e., after 12 hours all translog files will be deleted). This increases to chance to have an ops based recovery, even if the primary flushed or the replica was offline for a few hours. In order to see which parts of the translog are committed into lucene the translog stats are extended to include information about uncommitted operations. Views now include all translog ops and guarantee, as before, that those will not go away. Snapshotting a view allows to filter out generations that are not relevant based on a specific sequence number. Relates to #10708
2017-06-21[rest-api-spec/indices.refresh] Remove old paramsSpencer
Fixes #25234
2017-06-20[TEST] Add skip for 5.x BWC tests for custom filter in analyze APILee Hinman
Resolves #25316
2017-06-20Parse synonyms with the same analysis chain (#8049)Jun Ohtani
* [Analysis] Parse synonyms with the same analysis chain Synonym Token Filter / Synonym Graph Filter tokenize synonyms with whatever tokenizer and token filters appear before it in the chain. Close #7199
2017-06-15FastVectorHighlighter should not cache the field query globally (#25197)Jim Ferenczi
This commit removes the global caching of the field query and replaces it with a caching per field. Each field can use a different `highlight_query` and the rewriting of some queries (prefix, automaton, ...) depends on the targeted field so the query used for highlighting must be unique per field. There might be a small performance penalty when highlighting multiple fields since the query needs to be rewritten once per highlighted field with this change. Fixes #25171
2017-06-13Indices.rollover/10_basic should refresh to make the doc visible in lucene statsBoaz Leskes
2017-06-13Adapt skip version in ↵Boaz Leskes
rest-api-spec/test/indices.rollover/20_max_doc_condition.yml The relevant change was backported.
2017-06-13Rollover max docs should only count primaries (#24977)Sergey Galkin
max_doc condition for index rollover should use document count only from primary shards Fixes #24217
2017-06-12[docs] include two cluster doc pages missing from index (#25180)Spencer
* [docs] include two cluster doc pages missing from index * [rest-api-spec] update link to remote-info docs
2017-06-11Change BWC versions on get mapping 404sJason Tedor
This commit changes the BWC versions on the get mapping 404s now that this API returning 404s when a type is missing is supported since 5.5.0. Relates #23192
2017-06-11Fix get mappings HEAD requestsJason Tedor
Get mappings HEAD requests incorrectly return a content-length header of 0. This commit addresses this by removing the special handling for get mappings HEAD requests, and just relying on the general mechanism that exists for handling HEAD requests in the REST layer. Relates #23192
2017-06-10Test: remove faling test that relies on merge orderJim Ferenczi
2017-06-09Change BWC versions on create index responseJason Tedor
This commit changes the BWC versions on the create index response now that the index name in the response is supported since 5.6.0. Relates #25139
2017-06-09Return the index name on a create index responseSergey Novikov
This commit modifies the create index response so that it includes the index name. Relates #25139
2017-06-08Add Ingest-Processor specific Rest Endpoints & Add Grok endpoint (#25059)Tal Levy
This PR enables Ingest plugins to leverage processor-scoped REST endpoints. First of which being the Grok endpoint that retrieves Grok Patterns for users to retrieve all the built-in patterns. Example usage: Kibana Grok Autocomplete!
2017-06-08Correctly enable _all for older 5.x indicesLee Hinman
When we disabled `_all` by default for indices created in 6.0, we missed adding a layer that would handle the situation where `_all` was not enabled in 5.x and then the cluster was updated to 6.0, this means that when the cluster was updated the `_all` field would be disabled for 5.x indices and field values would not be added to the `_all` field. This adds a compatibility layer for 5.x indices where we treat the default enabled value for the `_all` field to be `true` if unset on 5.x indices. Resolves #25068
2017-06-08Include empty mappings in GET /{index}/_mappings requests (#25118)Lee Hinman
Previously this would output: ``` GET /test-1/_mappings { } ``` And after this change: ``` GET /test-1/_mappings { "test-1": { "mappings": {} } } ``` To bring parity back to the REST output after #24723. Relates to #25090
2017-06-08Return index name and empty map for /{index}/_alias with no aliasesLee Hinman
Previously in #24723 we changed the `_alias` API to not go through the `RestGetIndicesAction` endpoint, instead creating a `RestGetAliasesAction` that did the same thing. This changes the formatting so that it matches the old formatting of the endpoint, before: ``` GET /test-1/_alias { } ``` And after this change: ``` GET /test-1/_alias { "test-1": { "aliases": {} } } ``` This is related to #25090
2017-06-08Automatically early terminate search query based on index sorting (#24864)Jim Ferenczi
This commit refactors the query phase in order to be able to automatically detect queries that can be early terminated. If the index sort matches the query sort, the top docs collection is early terminated on each segment and the computing of the total number of hits that match the query is delegated to a simple TotalHitCountCollector. This change also adds a new parameter to the search request called `track_total_hits`. It indicates if the total number of hits that match the query should be tracked. If false, queries sorted by the index sort will not try to compute this information and and will limit the collection to the first N documents per segment. Aggregations are not impacted and will continue to see every document even when the index sort matches the query sort and `track_total_hits` is false. Relates #6720
2017-06-07Skip rest tests that use mutiple types in pure 6.x clusters (#24965)Simon Willnauer
This change skips rest tests that use mutlitple types if the cluster is a pure 6.x cluster. This allows all indics to be created with a version less than 6.0 and that means we can safely use the `mapping.single_type` setting. Relates to #24961
2017-06-06Modify skips for get missing alises testsJason Tedor
Previous work modified the status code on the get aliases API when an alias is missing so that these requests 404 now. This change was also backported to 5.5 so we can adjust the skips to skip everything before 5.5.0.
2017-06-06GET aliases should 404 if aliases are missingJason Tedor
Previously the HEAD and GET aliases endpoints were misaigned in behavior. The HEAD verb would 404 if any aliases are missing while the GET verb would not if any aliases existed. When HEAD was aligned with GET, this broke the previous usage of HEAD to serve as an existence check for aliases. It is the behavior of GET that is problematic here though, if any alias is missing the request should 404. This commit addresses this by modifying the behavior of GET to behave in this way. This fixes the behavior for HEAD to also 404 when aliases are missing. Relates #25043
2017-06-06Collapse inner hits rest test should not skip 5.xJim Ferenczi
Relates https://github.com/elastic/elasticsearch/pull/24517
2017-06-05Test: update missing body tests to run against versions >= 5.5.0jaymode
This updates the missing body tests to run against versions >= 5.5.0 after backporting the change to the 5.x branch. See #23497
2017-06-05Fixed NPEs caused by requests without content. (#23497)Alex Benusovich
REST handlers that require a body will throw an an ElasticsearchParseException "request body required". REST handlers that require a body OR source param will throw an ElasticsearchParseException "request body or source param required". Replaced asserts in BulkRequest parsing code with a more descriptive IllegalArgumentException if the line contains an empty object. Updated bulk REST test to verify an empty action line is rejected properly. Updated BulkRequestTests with randomized testing for an empty action line. Used try-with-resouces for XContentParser in AbstractBulkByQueryRestHandler.
2017-06-02[TEST] Skip wildcard expansion test due to breaking changeLee Hinman
Relates to #24723
2017-06-02Remove comma-separated feature parsing for GetIndicesActionLee Hinman
This removes the parsing of things like `GET /idx/_aliases,_mappings`, instead, a user must choose between retriving all index metadata with `GET /idx`, or only a specific form such as `GET /idx/_settings`. Relates to (and is a prerequisite of) #24437
2017-06-02Adds nodes usage API to monitor usages of actions (#24169)Colin Goodheart-Smithe
* Adds nodes usage API to monitor usages of actions The nodes usage API has 2 main endpoints /_nodes/usage and /_nodes/{nodeIds}/usage return the usage statistics for all nodes and the specified node(s) respectively. At the moment only one type of usage statistics is available, the REST actions usage. This records the number of times each REST action class is called and when the nodes usage api is called will return a map of rest action class name to long representing the number of times each of the action classes has been called. Still to do: * [x] Create usage service to store usage statistics * [x] Record usage in REST layer * [x] Add Transport Actions * [x] Add REST Actions * [x] Tests * [x] Documentation * Rafactors UsageService so counts are done by the handlers * Fixing up docs tests * Adds a name to all rest actions * Addresses review comments
2017-06-01Scripting: Add optional context parameter to put stored script requests (#25014)Ryan Ernst
This commit adds an optional `context` url parameter to the put stored script request. When a context is specified, the script is compiled against that context before storing, as a validation the script will work when used in that context.
2017-05-26Move BWC version to 5.5 after backportJim Ferenczi
Relates to #24517
2017-05-26Support Multiple Collapse Inner HitsMatt Weber
Support multiple named inner hits on a field collapsing request.
2017-05-24Test fix - rest test missing version skip for new 6.0 significant_text aggmarkharwood
2017-05-24SignificantText aggregation - like significant_terms, but for text (#24432)markharwood
* SignificantText aggregation - like significant_terms but doesn’t require fielddata=true, recommended used with `sampler` agg to limit expense of tokenizing docs and takes optional `filter_duplicate_text`:true setting to avoid stats skew from repeated sections of text in search results. Closes #23674
2017-05-17Scripting: Remove file scripts (#24627)Ryan Ernst
This commit removes file scripts, which were deprecated in 5.5. closes #21798
2017-05-17Fix ExpandSearchPhase when response contains no hits (#24688)Jim Ferenczi
This change skips the expand search phase entirely when there is no search hits in the response.
2017-05-16Tests: Change rest test extension from .yaml to .yml (#24659)Ryan Ernst
This commit renames all rest test files to use the .yml extension instead of .yaml. This way the extension used within all of elasticsearch for yaml is consistent.
2017-05-12Add parent-join module (#24638)Jim Ferenczi
* Add parent-join module This change adds a new module named `parent-join`. The goal of this module is to provide a replacement for the `_parent` field but as a first step this change only moves the `has_child`, `has_parent` queries and the `children` aggregation to this module. These queries and aggregations are no longer in core but they are deployed by default as a module. Relates #20257
2017-05-12Add rest test for sliced scroll (#24630)Jim Ferenczi
2017-05-11Compound order for histogram aggregations. (#22343)qwerty4030
This commit adds support for histogram and date_histogram agg compound order by refactoring and reusing terms agg order code. The major change is that the Terms.Order and Histogram.Order classes have been replaced/refactored into a new class BucketOrder. This is a breaking change for the Java Transport API. For backward compatibility with previous ES versions the (date)histogram compound order will use the first order. Also the _term and _time aggregation order keys have been deprecated; replaced by _key. Relates to #20003: now that all these aggregations use the same order code, it should be easier to move validation to parse time (as a follow up PR). Relates to #14771: histogram and date_histogram aggregation order will now be validated at reduce time. Closes #23613: if a single BucketOrder that is not a tie-breaker is added with the Java Transport API, it will be converted into a CompoundOrder with a tie-breaker.
2017-05-10Enhances get snapshots API to allow retrieving repository index only (#24477)Ali Beyad
Currently, the get snapshots API (e.g. /_snapshot/{repositoryName}/_all) provides information about snapshots in the repository, including the snapshot state, number of shards snapshotted, failures, etc. In order to provide information about each snapshot in the repository, the call must read the snapshot metadata blob (`snap-{snapshot_uuid}.dat`) for every snapshot. In cloud-based repositories, this can be expensive, both from a cost and performance perspective. Sometimes, all the user wants is to retrieve all the names/uuids of each snapshot, and the indices that went into each snapshot, without any of the other status information about the snapshot. This minimal information can be retrieved from the repository index blob (`index-N`) without needing to read each snapshot metadata blob. This commit enhances the get snapshots API with an optional `verbose` parameter. If `verbose` is set to false on the request, then the get snapshots API will only retrieve the minimal information about each snapshot (the name, uuid, and indices in the snapshot), and only read this information from the repository index blob, thereby giving users the option to retrieve the snapshots in a repository in a more cost-effective and efficient manner. Closes #24288
2017-05-10This adds max_concurrent_searches to multi-search-template endpoint.Isabel Drost-Fromm
Closes #20912
2017-05-09Identify documents by their `_id`. (#24460)Adrien Grand
Now that indices have a single type by default, we can move to the next step and identify documents using their `_id` rather than the `_uid`. One notable change in this commit is that I made deletions implicitly create types. This helps with the live version map in the case that documents are deleted before the first type is introduced. Otherwise there would be no way to differenciate `DELETE index/foo/1` followed by `PUT index/foo/1` from `DELETE index/bar/1` followed by `PUT index/foo/1`, even though those are different if versioning is involved.