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

Open
astefan opened this Issue Oct 11, 2018 · 1 comment

Comments

Projects
None yet
2 participants
@astefan
Contributor

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": {}
  }
}
@elasticmachine

This comment has been minimized.

Show comment
Hide comment
@elasticmachine

elasticmachine commented Oct 11, 2018

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