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

SQL: consider adding support for same document fields comparison #34400

astefan opened this Issue Oct 11, 2018 · 1 comment


None yet
2 participants

astefan commented Oct 11, 2018

The idea originally surfaced in this discuss thread. The solution fit for SQL would include the terms aggregation inside a composite one to allow for pagination:

GET flights/_search
  "size": 0,
  "_source": {
    "excludes": []
  "aggs": {
    "whatever": {
      "composite": {
        "sources": [
            "2": {
              "terms": {
                "script": {
                  "source": "if (doc['DestWeather.keyword'] == doc['OriginWeather.keyword']) return doc['DestWeather.keyword']; else return 'other';",
                  "lang": "painless"
  "query": {
    "match_all": {}

This comment has been minimized.

Show comment
Hide comment

elasticmachine commented Oct 11, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment