Skip to content

Beyond SQL Features

shiyuan edited this page Jan 4, 2018 · 12 revisions

Some more features using ElasticSearch capabilities

  1. ES TopHits
  2. ES MISSING
  3. ES STATS
  4. ES EXTENDED_STATS
  5. ES PERCENTILES
  6. ES TERMS/TERM
  7. ES IDS syntax: IDS_QUERY(type, ids..)
  8. ES SCRIPTED_METRIC (read about it on Aggregations page)
  9. ES QUERY_STRING

examples

SELECT * FROM account where nickname is not missing
```<br>
```sql
SELECT * FROM account where nickname is missing
```<br>
```sql
SELECT * FROM account where name = IN_TERMS(hattie,alis)
```<br>
```sql
SELECT * FROM account where age = TERM(4)
```<br>
```sql
SELECT * FROM account where _id = IDS_QUERY(account,1,2,5)
```<br>
```sql
SELECT stats(age) FROM account
```<br>
```sql
SELECT extended_stats(age) FROM account
```<br>
```sql
SELECT percentiles(age) FROM accounts
```<br>
```sql
SELECT address FROM bank where q=query('address:880 Holmes Lane')
```<br>
```sql
SELECT * FROM dog where dog_name = REGEXP_QUERY('sn.*', 'INTERSECTION|COMPLEMENT|EMPTY', 10000)

Clone this wiki locally