Skip to content

Instantly share code, notes, and snippets.

@kosho
Last active June 14, 2018 06:30
Show Gist options
  • Save kosho/5e7d85f1051cd4365ee238d30de8286e to your computer and use it in GitHub Desktop.
Save kosho/5e7d85f1051cd4365ee238d30de8286e to your computer and use it in GitHub Desktop.
# Search the earthquake dataset with SQL
POST /_xpack/sql?format=txt
{
"query": "SELECT \"@timestamp\", mag, depth FROM \"ncedc-earthquakes\" where (mag > 7) ORDER BY \"@timestamp\" desc LIMIT 10"
}
# Translate SQL into QueryDSL
POST /_xpack/sql/translate
{
"query": "SELECT \"@timestamp\", mag, depth FROM \"ncedc-earthquakes\" where (mag > 7)"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment