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

Use params in dynamic ES queries #33

Open
rimutaka opened this issue Apr 1, 2022 · 0 comments
Open

Use params in dynamic ES queries #33

rimutaka opened this issue Apr 1, 2022 · 0 comments
Labels

Comments

@rimutaka
Copy link
Member

rimutaka commented Apr 1, 2022

Building dynamic ES queries without parameters feels totally wrong. For example:

GET dev/_search
{
  "aggs": {
    "suggestions": {
      "terms": {
        "field": "report.tech.pkgs_kw.k.keyword",
        "include": "mon.*"
      }
    }
  },
  "size": 0
}

where "include": "mon.*" is a dynamic field filled with user input. It allows Regex, so has to be thoroughly validated and escaped.

There should be a way of doing it via params like in SQL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant