51d53791fe
Today when parsing a request, Elasticsearch silently ignores incorrect (including parameters with typos) or unused parameters. This is bad as it leads to requests having unintended behavior (e.g., if a user hits the _analyze API and misspell the "tokenizer" then Elasticsearch will just use the standard analyzer, completely against intentions). This commit removes lenient URL parameter parsing. The strategy is simple: when a request is handled and a parameter is touched, we mark it as such. Before the request is actually executed, we check to ensure that all parameters have been consumed. If there are remaining parameters yet to be consumed, we fail the request with a list of the unconsumed parameters. An exception has to be made for parameters that format the response (as opposed to controlling the request); for this case, handlers are able to provide a list of parameters that should be excluded from tripping the unconsumed parameters check because those parameters will be used in formatting the response. Additionally, some inconsistencies between the parameters in the code and in the docs are corrected. Relates #20722 |
||
---|---|---|
.. | ||
src/main/java/org/elasticsearch/plugin/noop | ||
README.md | ||
build.gradle |
README.md
Purpose
This plugin provides empty REST and transport endpoints for bulk indexing and search. It is used to avoid accidental server-side bottlenecks in client-side benchmarking.
Build Instructions
Build the plugin with gradle :client:client-benchmark-noop-api-plugin:assemble
from the Elasticsearch root project directory.
Installation Instructions
After, the binary has been built, install it with bin/elasticsearch-plugin install file:///full/path/to/noop-plugin.zip
.
Usage
The plugin provides two REST endpoints:
/_noop_bulk
and all variations that the bulk endpoint provides (except that all no op endpoints are called_noop_bulk
instead of_bulk
)_noop_search
and all variations that the search endpoint provides (except that all no op endpoints are called_noop_search
instead of_search
)
The corresponding transport actions are:
org.elasticsearch.plugin.noop.action.bulk.TransportNoopBulkAction
org.elasticsearch.plugin.noop.action.search.TransportNoopSearchAction