Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Indexed script fixes #7929

Closed
wants to merge 5 commits into from
Closed

Conversation

GaelTadh
Copy link
Contributor

On Disk Scripts : Make on disk scripts re-load timing dynamically configurable.
This change adds a new resource watcher level of CUSTOM and allows the addition of custom levels of timing.
This is used by the ScriptService to register the FileWatcher.

Search Templates: Add render endpoint for rendering templates
This commit adds a render endpoint to allow rendering of templates.

POST /_render/template
'{
  "template":
  {
    "query":
      {
        "{{foo}}": {}
      },
    "size": "{{my_{{}}size}}"
   },
   "params": { "foo": "match_all", "my_size": 10}
}'

Will render

{
  "template" :
  {
    "query" : {
      "match_all" : {}
    },
    "size" : 10
  }
}

Closes #6821

This commit adds a render endpoint to allow rendering of templates.
````
POST /_render/template
'{
  "template":
  {
    "query":
      {
        "{{foo}}": {}
      },
    "size": "{{my_{{}}size}}"
   },
   "params": { "foo": "match_all", "my_size": 10}
}'
````
Will render
````
{
  "template" :
  {
    "query" : {
      "match_all" : {}
    },
    "size" : 10
  }
}
````

Closes elastic#6821
…figurable.

This change adds a new resource watcher level of CUSTOM and allows the addition of custom levels of timing.
This is used by the ScriptService to register the FileWatcher.
This commit allows the refresh timings for on disk scripts to be dymanically updated.
Also adds a test to make sure that new scripts are available at search time.
@GaelTadh
Copy link
Contributor Author

I'm updating the docs for the new timing parameter right now.

protected void handleRequest(RestRequest request, RestChannel channel, Client client) throws Exception {
XContentBuilder builder = XContentFactory.contentBuilder(XContentType.JSON);
try {
TemplateQueryParser.TemplateContext templateContext = SearchService.getTemplateContext(request.content());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will this work with a client node? I mean I am not sure if all the nodes have all templates. I think you should use the client here to fetch the template.

@s1monw
Copy link
Contributor

s1monw commented Oct 6, 2014

I left some comments, yet I think the rendering functionality is awesome but the custom reload interval I am not sure about. What is the usecase and / or where is LOW not LOW enough?

@s1monw
Copy link
Contributor

s1monw commented Mar 2, 2015

@GaelTadh this has been stalled since 5 month, what's the status?

@javanna
Copy link
Member

javanna commented Jul 3, 2015

This PR is very old, most of it got merged with #11570 anyway. Closing.

@javanna javanna closed this Jul 3, 2015
@clintongormley clintongormley added :Core/Infra/Scripting Scripting abstractions, Painless, and Mustache and removed :Indexed Scripts/Templates labels Feb 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Core/Infra/Scripting Scripting abstractions, Painless, and Mustache >enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add endpoint to test/debug/view a rendered template query
4 participants