summaryrefslogtreecommitdiff
path: root/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/TransportSearchTemplateAction.java
AgeCommit message (Collapse)Author
2017-07-03Remove QueryParseContext (#25486)Christoph Büscher
QueryParseContext is currently only used as a wrapper for an XContentParser, so this change removes it entirely and changes the appropriate APIs that use it so far to only accept a parser instead.
2017-06-02Scripting: Convert CompiledTemplate to a ScriptContext (#25032)Ryan Ernst
This commit creates TemplateScript and associated classes so that templates no longer need a special ScriptService.compileTemplate method. The execute() method is equivalent to the old run() method. relates #20426
2017-05-25Scripting: Move context definitions to instance type classes (#24883)Ryan Ernst
This is a simple refactoring to move the context definitions into the type that they use. While we have multiple context names for the same class at the moment, this will eventually become one ScriptContext per instance type, so the pattern of a static member on the interface called CONTEXT can be used. This commit also moves the consolidated list of contexts provided by core ES into ScriptModule.
2017-05-24Scripting: Add instance and compiled classes to script contexts (#24868)Ryan Ernst
This commit modifies the compile method of ScriptService to be context aware. The ScriptContext is now a generic class which contains both the instance type and compiled type for a script. Instance type may be stateful (for example, pre loading field information for the index a script will execute on, like in expressions), while the compiled type is stateless and used to construct instance type instances. This change is only a first step to cutover ScriptService to the new paradigm. It only converts callers to the script service, and has a small shim to wrap compilation from the script engines to support the current two fixed instance types, SearchScript and ExecutableScript.
2017-05-22Scripting: Simplify ScriptContext (#24818)Ryan Ernst
As we work towards contexts implying the return type of compilation, we first need ScriptContext to not be an enum. This commit removes the Standard enum and Plugin subclass of ScriptContext.
2017-05-15Scripts: Convert template script engines to return String instead of ↵Ryan Ernst
BytesReference (#24447) Template script engines (mustache, the only one) currently return a BytesReference that users must know is utf8 encoded. This commit modifies all callers and mustache to have the template engine return String. This is much simpler, and does not require decoding in order to use (for example, in ingest).
2017-05-10Rewrite multi search template api to delegate to multi search api instead of ↵Martijn van Groningen
to search template api. The max concurrent searches logic is complex and we shouldn't duplicate that in multi search template api, so we should template each individual template search request and then delegate to multi search api.
2017-05-10Scripting: Remove "service" from ScriptEngine interface name (#24574)Ryan Ernst
This commit renames ScriptEngineService to ScriptEngine. It is often confusing because we have the ScriptService, and then ScriptEngineService implementations, but the latter are not services as we see in other places in elasticsearch.
2017-04-24Templates: Add compileTemplate method to ScriptService for template ↵Ryan Ernst
consumers (#24280) This commit adds a compileTemplate method to the ScriptService. Eventually this will be used to easily cutover all consumers to a new TemplateService. relates #16314
2017-04-21Scripts: Remove unnecessary executable shortcut (#24264)Ryan Ernst
ScriptService has two executable methods, one which takes a CompiledScript, which is similar to search, and one that takes a raw Script and both compiles and returns an ExecutableScript for it. The latter is not needed, and the call sites which used one or the other were mixed. This commit removes the extra executable method in favor of callers first calling compile, then executable.
2017-02-22Remove content type auto-detection from search templatesjavanna
Now that search templates always get converted to json, we don't need to try and auto-detect their content-type, which anyways didn't work as expected before given that only json was really working.
2017-01-12Remove ParseFieldMatcher usages from QueryParseContextjavanna
2017-01-11Remove SearchRequestParsers (#22538)Nik Everett
It is empty now that we've moved all the parsing into `namedObject`.
2017-01-09Replace Suggesters with namedObject (#22491)Nik Everett
Removes another parser registery type thing in favor of `XContentParser#namedObject`.
2017-01-09Replace AggregatorParsers with namedObject (#22397)Nik Everett
Removes `AggregatorParsers`, replacing all of its functionality with `XContentParser#namedObject`. This is the third bit of payoff from #22003, one less thing to pass around the entire application.
2017-01-09Replace SearchExtRegistry with namedObject (#22492)Nik Everett
This is one of the last things in `SearchRequestParsers`.
2016-12-21Replace IndicesQueriesRegistry (#22289)Nik Everett
* Switch query parsing to namedObject * Remove IndicesQueriesRegistry
2016-12-20Introduce XContentParser#namedObject (#22003)Nik Everett
Introduces `XContentParser#namedObject which works a little like `StreamInput#readNamedWriteable`: on startup components register parsers under names and a superclass. At runtime we look up the parser and call it to parse the object. Right now the parsers take a context object they use to help with the parsing but I hope to be able to eliminate the need for this context as most what it is used for at this point is to move around parser registries which should be replaced by this method eventually. I make no effort to do so in this PR because it is big enough already. This is meant to the a start down a road that allows us to remove classes like `QueryParseContext`, `AggregatorParsers`, `IndicesQueriesRegistry`, and `ParseFieldRegistry`. The goal here is to reduce the amount of plumbing required to allow parsing pluggable things. With this you don't have to pass registries all over the place. Instead you must pass a super registry to fewer places and use it to wrap the reader. This is the same tradeoff that we use for NamedWriteable and it allows much, much simpler binary serialization. We think we want that same thing for xcontent serialization. The only parsing actually converted to this method is parsing `ScoreFunctions` inside of `FunctionScoreQuery`. I chose this because it is relatively self contained.
2016-11-10Clean up of Script.Jack Conradson
Closes #21321
2016-09-19Add profile and explain parameters to template APIDavid Pilato
We can now run templates using `explain` and/or `profile` parameters. Which is interesting when you have defined a complicated profile but want to debug it in an easier way than running the full query again. You can use `explain` parameter when running a template: ```js GET /_search/template { "file": "my_template", "params": { "status": [ "pending", "published" ] }, "explain": true } ``` You can use `profile` parameter when running a template: ```js GET /_search/template { "file": "my_template", "params": { "status": [ "pending", "published" ] }, "profile": true } ```
2016-09-09move parsing of search ext sections to the coordinating nodejavanna
2016-08-16Internal: Consolidate search parser registriesRyan Ernst
Parsing a search request is currently split up among a number of classes, using multiple public static methods, which take multiple regstries of elements that may appear in the search request like query parsers and aggregations. This change begins consolidating all this code by collapsing the registries normally used for parsing search requests into a single SearchRequestParsers class. It is also made available to plugin services to enable templating of search requests. Eventually all of the actual parsing logic should move to the class, and the registries should be hidden, but for now they are at least co-located to reduce the number of objects that must be passed around.
2016-07-25Moved all mustache classes into one package.Martijn van Groningen
No need for multiple packages inside a small module.