Skip to content

Repository files navigation

DEPRECATED

Please note, this project is no longer in active development, and is deprecated, please use official version x-pack-sql.


Elasticsearch-SQL

build status

1.7.61.7.6 Build Status2.0.02.0.0 Build Status2.1.02.1.0 Build Status2.1.12.1.1 Build Status2.1.22.1.2 Build Status2.2.02.2.0 Build Status
2.2.12.2.1 Build Status2.3.02.3.0 Build Status2.3.12.3.1 Build Status2.3.22.3.2 Build Status2.3.32.3.3 Build Status2.3.42.3.4 Build Status
2.3.52.3.5 Build Status2.4.02.4.0 Build Status2.4.12.4.1 Build Status2.4.22.4.2 Build Status2.4.32.4.3 Build Status2.4.42.4.4 Build Status
2.4.52.4.5 Build Status2.4.62.4.6 Build Status5.0.15.0.1 Build Status5.1.15.1.1 Build Status5.1.25.1.2 Build Status5.2.05.2.0 Build Status
5.2.15.2.1 Build Status5.2.25.2.2 Build Status5.3.05.3.0 Build Status5.3.15.3.1 Build Status5.3.25.3.2 Build Status5.3.35.3.3 Build Status
5.4.05.4.0 Build Status5.4.15.4.1 Build Status5.4.25.4.2 Build Status5.4.35.4.3 Build Status5.5.05.5.0 Build Status5.5.15.5.1 Build Status
5.5.25.5.2 Build Status5.5.35.5.3 Build Status5.6.05.6.0 Build Status5.6.15.6.1 Build Status5.6.25.6.2 Build Status5.6.35.6.3 Build Status
5.6.45.6.4 Build Status5.6.55.6.5 Build Status5.6.65.6.6 Build Status5.6.75.6.7 Build Status5.6.85.6.8 Build Status5.6.95.6.9 Build Status
5.6.105.6.10 Build Status5.6.115.6.11 Build Status5.6.125.6.12 Build Status5.6.135.6.13 Build Status5.6.145.6.14 Build Status5.6.155.6.15 Build Status
5.6.165.6.16 Build Status6.0.06.0.0 Build Status6.0.16.0.1 Build Status6.1.06.1.0 Build Status6.1.16.1.1 Build Status6.1.26.1.2 Build Status
6.1.36.1.3 Build Status6.1.46.1.4 Build Status6.2.06.2.0 Build Status6.2.16.2.1 Build Status6.2.26.2.2 Build Status6.2.36.2.3 Build Status
6.2.46.2.4 Build Status6.3.06.3.0 Build Status6.3.16.3.1 Build Status6.3.26.3.2 Build Status6.4.06.4.0 Build Status6.4.16.4.1 Build Status
6.4.26.4.2 Build Status6.4.36.4.3 Build Status6.5.06.5.0 Build Status6.5.16.5.1 Build Status6.5.26.5.2 Build Status6.5.36.5.3 Build Status
6.5.46.5.4 Build Status6.6.06.6.0 Build Status6.6.16.6.1 Build Status6.6.26.6.2 Build Status6.7.06.7.0 Build Status6.7.16.7.1 Build Status
6.7.26.7.2 Build Status6.8.06.8.0 Build Status6.8.16.8.1 Build Status6.8.26.8.2 Build Status6.8.36.8.3 Build Status6.8.46.8.4 Build Status
7.0.07.0.0 Build Status7.0.17.0.1 Build Status7.1.07.1.0 Build Status7.1.17.1.1 Build Status7.2.07.2.0 Build Status7.2.17.2.1 Build Status
7.3.07.3.0 Build Status7.3.17.3.1 Build Status7.3.27.3.2 Build Status7.4.07.4.0 Build Status7.4.17.4.1 Build Status7.4.27.4.2 Build Status

Query elasticsearch using familiar SQL syntax. You can also use ES functions in SQL.

Check out our wiki!

explain example

you can visite : http://essql.nlpcn.org/ , it is a sample example for explain

Web frontend overview

Web frontend overview

SETUP

Install as plugin: Versions

elasticsearch versionlatest versionremarksbranch
1.x1.7.6tested against elastic 1.7.6elastic1.x
2.0.02.0.4delete commands not supportedelastic2.0
2.1.02.1.0.2delete commands not supportedelastic2.1
2.1.12.1.1.1delete commands not supportedelastic2.1.1
2.1.22.1.2.0delete commands not supportedelastic2.1.2
2.2.02.2.0.1delete commands not supportedelastic2.2.0
2.2.12.2.1.0delete commands not supportedelastic2.2.1
2.3.02.3.0.0delete commands not supportedelastic2.3.0
2.3.12.3.1.1delete commands not supportedelastic2.3.1
2.3.22.3.2.0delete commands not supportedelastic2.3.2
2.3.32.3.3.0delete commands not supportedelastic2.3.3
2.3.42.3.4.0delete commands not supportedelastic2.3.4
2.3.52.3.5.0delete commands not supportedelastic2.3.5
2.4.02.4.0.1delete commands not supportedelastic2.4.0
2.4.12.4.1.0delete commands not supportedelastic2.4.1
2.4.22.4.2.1delete commands not supportedelastic2.4.2
2.4.32.4.3.0delete commands not supportedelastic2.4.3
2.4.42.4.4.0delete commands not supportedelastic2.4.4
2.4.52.4.5.0delete commands not supportedelastic2.4.5
2.4.62.4.6.0delete commands not supportedelastic2.4.6
5.0.15.0.1.0delete commands not supportedelastic5.0.1
5.1.15.1.1.0delete commands not supportedelastic5.1.1
5.1.25.1.2.0delete commands not supportedelastic5.1.2
5.2.05.2.0.0delete commands not supportedelastic5.2.0
5.2.15.2.1.0delete commands not supportedelastic5.2.1
5.2.25.2.2.0delete commands not supportedelastic5.2.2
5.3.05.3.0.0delete commands not supportedelastic5.3.0
5.3.15.3.1.0delete commands not supportedelastic5.3.1
5.3.25.3.2.0delete commands not supportedelastic5.3.2
5.3.35.3.3.0delete commands not supportedelastic5.3.3
5.4.05.4.0.0delete commands not supportedelastic5.4.0
5.4.15.4.1.0delete commands not supportedelastic5.4.1
5.4.25.4.2.0delete commands not supportedelastic5.4.2
5.4.35.4.3.0delete commands not supportedelastic5.4.3
5.5.05.5.0.1delete commands not supportedelastic5.5.0
5.5.15.5.1.0delete commands not supportedelastic5.5.1
5.5.25.5.2.0delete commands not supportedelastic5.5.2
5.5.35.5.3.0delete commands not supportedelastic5.5.3
5.6.05.6.0.0delete commands not supportedelastic5.6.0
5.6.15.6.1.0delete commands not supportedelastic5.6.1
5.6.25.6.2.0delete commands not supportedelastic5.6.2
5.6.35.6.3.0delete commands not supportedelastic5.6.3
5.6.45.6.4.0delete commands not supportedelastic5.6.4
5.6.55.6.5.0delete commands not supportedelastic5.6.5
5.6.65.6.6.0elastic5.6.6
5.6.75.6.7.0elastic5.6.7
5.6.85.6.8.0elastic5.6.8
5.6.95.6.9.0elastic5.6.9
5.6.105.6.10.0elastic5.6.10
5.6.115.6.11.0elastic5.6.11
5.6.125.6.12.0elastic5.6.12
5.6.135.6.13.0elastic5.6.13
5.6.145.6.14.0elastic5.6.14
5.6.155.6.15.0elastic5.6.15
5.6.165.6.16.0elastic5.6.16
6.0.06.0.0.0elastic6.0.0
6.0.16.0.1.0elastic6.0.1
6.1.06.1.0.0elastic6.1.0
6.1.16.1.1.0elastic6.1.1
6.1.26.1.2.0elastic6.1.2
6.1.36.1.3.0elastic6.1.3
6.1.46.1.4.0elastic6.1.4
6.2.06.2.0.0elastic6.2.0
6.2.16.2.1.0elastic6.2.1
6.2.26.2.2.0elastic6.2.2
6.2.36.2.3.0elastic6.2.3
6.2.46.2.4.0elastic6.2.4
6.3.06.3.0.0elastic6.3.0
6.3.16.3.1.0elastic6.3.1
6.3.26.3.2.0elastic6.3.2
6.4.06.4.0.0elastic6.4.0
6.4.16.4.1.0elastic6.4.1
6.4.26.4.2.0elastic6.4.2
6.4.36.4.3.0elastic6.4.3
6.5.06.5.0.0elastic6.5.0
6.5.16.5.1.0elastic6.5.1
6.5.26.5.2.0elastic6.5.2
6.5.36.5.3.0elastic6.5.3
6.5.46.5.4.0elastic6.5.4
6.6.06.6.0.0elastic6.6.0
6.6.16.6.1.0elastic6.6.1
6.6.26.6.2.0elastic6.6.2
6.7.06.7.0.0elastic6.7.0
6.7.16.7.1.0elastic6.7.1
6.7.26.7.2.0elastic6.7.2
6.8.06.8.0.0elastic6.8.0
6.8.16.8.1.0elastic6.8.1
6.8.26.8.2.0elastic6.8.2
6.8.36.8.3.0elastic6.8.3
6.8.46.8.4.0elastic6.8.4
7.0.07.0.0.0elastic7.0.0
7.0.17.0.1.0elastic7.0.1
7.1.07.1.0.0elastic7.1.0
7.1.17.1.1.0elastic7.1.1
7.2.07.2.0.0elastic7.2.0
7.2.17.2.1.0elastic7.2.1
7.3.07.3.0.0elastic7.3.0
7.3.17.3.1.0elastic7.3.1
7.3.27.3.2.0elastic7.3.2
7.4.07.4.0.0elastic7.4.0
7.4.17.4.1.0elastic7.4.1
7.4.27.4.2.0elastic7.4.2

Elasticsearch 1.x

./bin/plugin -u https://github.com/NLPchina/elasticsearch-sql/releases/download/1.7.6/elasticsearch-sql-1.7.6.zip --install sql

Elasticsearch 2.0.0

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.0.4/elasticsearch-sql-2.0.4.zip 

Elasticsearch 2.1.0

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.1.0.2/elasticsearch-sql-2.1.0.2.zip 

Elasticsearch 2.1.1

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.1.1.1/elasticsearch-sql-2.1.1.1.zip 

Elasticsearch 2.1.2

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.1.2.0/elasticsearch-sql-2.1.2.0.zip 

Elasticsearch 2.2.0

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.2.0.1/elasticsearch-sql-2.2.0.1.zip 

Elasticsearch 2.2.1

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.2.1.0/elasticsearch-sql-2.2.1.0.zip 

Elasticsearch 2.3.0

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.3.0.0/elasticsearch-sql-2.3.0.0.zip 

Elasticsearch 2.3.1

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.3.1.1/elasticsearch-sql-2.3.1.1.zip 

Elasticsearch 2.3.2

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.3.2.0/elasticsearch-sql-2.3.2.0.zip 

Elasticsearch 2.3.3

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.3.3.0/elasticsearch-sql-2.3.3.0.zip 

Elasticsearch 2.3.4

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.3.4.0/elasticsearch-sql-2.3.4.0.zip 

Elasticsearch 2.3.5

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.3.5.0/elasticsearch-sql-2.3.5.0.zip 

Elasticsearch 2.4.0

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.4.0.1/elasticsearch-sql-2.4.0.1.zip

Elasticsearch 2.4.1

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.4.1.0/elasticsearch-sql-2.4.1.0.zip

Elasticsearch 2.4.2

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.4.2.1/elasticsearch-sql-2.4.2.1.zip

Elasticsearch 2.4.3

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.4.3.0/elasticsearch-sql-2.4.3.0.zip

Elasticsearch 2.4.4

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.4.4.0/elasticsearch-sql-2.4.4.0.zip

Elasticsearch 2.4.5

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.4.5.0/elasticsearch-sql-2.4.5.0.zip

Elasticsearch 2.4.6

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.4.6.0/elasticsearch-sql-2.4.6.0.zip

Elasticsearch 5.0.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.0.1/elasticsearch-sql-5.0.1.0.zip

Elasticsearch 5.1.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.1.1.0/elasticsearch-sql-5.1.1.0.zip

Elasticsearch 5.1.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.1.2.0/elasticsearch-sql-5.1.2.0.zip

Elasticsearch 5.2.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.2.0.0/elasticsearch-sql-5.2.0.0.zip

Elasticsearch 5.2.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.2.1.0/elasticsearch-sql-5.2.1.0.zip

Elasticsearch 5.2.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.2.2.0/elasticsearch-sql-5.2.2.0.zip

Elasticsearch 5.3.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.3.0.0/elasticsearch-sql-5.3.0.0.zip

Elasticsearch 5.3.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.3.1.0/elasticsearch-sql-5.3.1.0.zip

Elasticsearch 5.3.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.3.2.0/elasticsearch-sql-5.3.2.0.zip

Elasticsearch 5.3.3

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.3.3.0/elasticsearch-sql-5.3.3.0.zip

Elasticsearch 5.4.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.4.0.0/elasticsearch-sql-5.4.0.0.zip

Elasticsearch 5.4.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.4.1.0/elasticsearch-sql-5.4.1.0.zip

Elasticsearch 5.4.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.4.2.0/elasticsearch-sql-5.4.2.0.zip

Elasticsearch 5.4.3

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.4.3.0/elasticsearch-sql-5.4.3.0.zip

Elasticsearch 5.5.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.5.0.0/elasticsearch-sql-5.5.0.1.zip

Elasticsearch 5.5.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.5.1.0/elasticsearch-sql-5.5.1.0.zip

Elasticsearch 5.5.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.5.2.0/elasticsearch-sql-5.5.2.0.zip

Elasticsearch 5.5.3

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.5.3.0/elasticsearch-sql-5.5.3.0.zip

Elasticsearch 5.6.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.0.0/elasticsearch-sql-5.6.0.0.zip

Elasticsearch 5.6.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.1.0/elasticsearch-sql-5.6.1.0.zip

Elasticsearch 5.6.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.2.0/elasticsearch-sql-5.6.2.0.zip

Elasticsearch 5.6.3

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.3.0/elasticsearch-sql-5.6.3.0.zip

Elasticsearch 5.6.4

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.4.0/elasticsearch-sql-5.6.4.0.zip

Elasticsearch 5.6.5

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.5.0/elasticsearch-sql-5.6.5.0.zip

Elasticsearch 5.6.6

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.6.0/elasticsearch-sql-5.6.6.0.zip

Elasticsearch 5.6.7

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.7.0/elasticsearch-sql-5.6.7.0.zip

Elasticsearch 5.6.8

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.8.0/elasticsearch-sql-5.6.8.0.zip

Elasticsearch 5.6.9

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.9.0/elasticsearch-sql-5.6.9.0.zip

Elasticsearch 5.6.10

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.10.0/elasticsearch-sql-5.6.10.0.zip

Elasticsearch 5.6.11

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.11.0/elasticsearch-sql-5.6.11.0.zip

Elasticsearch 5.6.12

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.12.0/elasticsearch-sql-5.6.12.0.zip

Elasticsearch 5.6.13

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.13.0/elasticsearch-sql-5.6.13.0.zip

Elasticsearch 5.6.14

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.14.0/elasticsearch-sql-5.6.14.0.zip

Elasticsearch 5.6.15

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.15.0/elasticsearch-sql-5.6.15.0.zip

Elasticsearch 5.6.16

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.16.0/elasticsearch-sql-5.6.16.0.zip

Elasticsearch 6.0.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.0.0.0/elasticsearch-sql-6.0.0.0.zip

Elasticsearch 6.0.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.0.1.0/elasticsearch-sql-6.0.1.0.zip

Elasticsearch 6.1.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.1.0.0/elasticsearch-sql-6.1.0.0.zip

Elasticsearch 6.1.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.1.1.0/elasticsearch-sql-6.1.1.0.zip

Elasticsearch 6.1.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.1.2.0/elasticsearch-sql-6.1.2.0.zip

Elasticsearch 6.1.3

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.1.3.0/elasticsearch-sql-6.1.3.0.zip

Elasticsearch 6.1.4

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.1.4.0/elasticsearch-sql-6.1.4.0.zip

Elasticsearch 6.2.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.2.0.0/elasticsearch-sql-6.2.0.0.zip

Elasticsearch 6.2.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.2.1.0/elasticsearch-sql-6.2.1.0.zip

Elasticsearch 6.2.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.2.2.0/elasticsearch-sql-6.2.2.0.zip

Elasticsearch 6.2.3

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.2.3.0/elasticsearch-sql-6.2.3.0.zip

Elasticsearch 6.2.4

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.2.4.0/elasticsearch-sql-6.2.4.0.zip

Elasticsearch 6.3.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.3.0.0/elasticsearch-sql-6.3.0.0.zip

Elasticsearch 6.3.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.3.1.0/elasticsearch-sql-6.3.1.1.zip

Elasticsearch 6.3.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.3.2.0/elasticsearch-sql-6.3.2.0.zip

Elasticsearch 6.4.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.4.0.0/elasticsearch-sql-6.4.0.0.zip

Elasticsearch 6.4.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.4.1.0/elasticsearch-sql-6.4.1.0.zip

Elasticsearch 6.4.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.4.2.0/elasticsearch-sql-6.4.2.0.zip

Elasticsearch 6.4.3

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.4.3.0/elasticsearch-sql-6.4.3.0.zip

Elasticsearch 6.5.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.5.0.0/elasticsearch-sql-6.5.0.0.zip

Elasticsearch 6.5.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.5.1.0/elasticsearch-sql-6.5.1.0.zip

Elasticsearch 6.5.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.5.2.0/elasticsearch-sql-6.5.2.0.zip

Elasticsearch 6.5.3

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.5.3.0/elasticsearch-sql-6.5.3.0.zip

Elasticsearch 6.5.4

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.5.4.0/elasticsearch-sql-6.5.4.0.zip

Elasticsearch 6.6.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.6.0.0/elasticsearch-sql-6.6.0.0.zip

Elasticsearch 6.6.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.6.1.0/elasticsearch-sql-6.6.1.0.zip

Elasticsearch 6.6.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.6.2.0/elasticsearch-sql-6.6.2.0.zip

Elasticsearch 6.7.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.7.0.0/elasticsearch-sql-6.7.0.0.zip

Elasticsearch 6.7.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.7.1.0/elasticsearch-sql-6.7.1.0.zip

Elasticsearch 6.7.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.7.2.0/elasticsearch-sql-6.7.2.0.zip

Elasticsearch 6.8.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.8.0.0/elasticsearch-sql-6.8.0.0.zip

Elasticsearch 6.8.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.8.1.0/elasticsearch-sql-6.8.1.0.zip

Elasticsearch 6.8.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.8.2.0/elasticsearch-sql-6.8.2.0.zip

Elasticsearch 6.8.3

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.8.3.0/elasticsearch-sql-6.8.3.0.zip

Elasticsearch 6.8.4

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.8.4.0/elasticsearch-sql-6.8.4.0.zip

Elasticsearch 7.0.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.0.0.0/elasticsearch-sql-7.0.0.0.zip

Elasticsearch 7.0.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.0.1.0/elasticsearch-sql-7.0.1.0.zip

Elasticsearch 7.1.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.1.0.0/elasticsearch-sql-7.1.0.0.zip

Elasticsearch 7.1.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.1.1.0/elasticsearch-sql-7.1.1.0.zip

Elasticsearch 7.2.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.2.0.0/elasticsearch-sql-7.2.0.0.zip

Elasticsearch 7.2.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.2.1.0/elasticsearch-sql-7.2.1.0.zip

Elasticsearch 7.3.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.3.0.0/elasticsearch-sql-7.3.0.0.zip

Elasticsearch 7.3.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.3.1.0/elasticsearch-sql-7.3.1.0.zip

Elasticsearch 7.3.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.3.2.0/elasticsearch-sql-7.3.2.0.zip

Elasticsearch 7.4.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.4.0.0/elasticsearch-sql-7.4.0.0.zip

Elasticsearch 7.4.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.4.1.0/elasticsearch-sql-7.4.1.0.zip

Elasticsearch 7.4.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.4.2.0/elasticsearch-sql-7.4.2.0.zip

After doing this, you need to restart the Elasticsearch server. Otherwise you may get errors like Invalid index name [sql], must not start with '']; ","status":400}.

Basic Usage

On elasticsearch 1.x / 2.x, visit the elasticsearch-sql web front-end:

http://localhost:9200/_plugin/sql/

On elasticsearch 5.x/6.x, use elasticsearch sql site chrome extension (make sure to enable cors on elasticsearch.yml). Alternatively, download and extract site, then start the web front-end like this:

cd site-server
npm install express --save
node node-server.js 
  • Simple query
curl -X GET "localhost:9200/_sql" -H 'Content-Type: application/json' -d'select * from indexName limit 10'
  • Explain SQL to elasticsearch query DSL
curl -X GET "localhost:9200/_sql/_explain" -H 'Content-Type: application/json' -d'select * from indexName limit 10'

SQL Usage

  • Query

     SELECT * FROM bank WHERE age >30 AND gender = 'm'
    
  • Aggregation

     select COUNT(*),SUM(age),MIN(age) as m, MAX(age),AVG(age)
    FROM bank GROUP BY gender ORDER BY SUM(age), m DESC
    
  • Delete

     DELETE FROM bank WHERE age >30 AND gender = 'm'
    

Beyond SQL

  • Search

     SELECT address FROM bank WHERE address = matchQuery('880 Holmes Lane') ORDER BY _score DESC LIMIT 3
    
  • Aggregations

    • range age group 20-25,25-30,30-35,35-40

       SELECT COUNT(age) FROM bank GROUP BY range(age, 20,25,30,35,40)
      
    • range date group by day

       SELECT online FROM online GROUP BY date_histogram(field='insert_time','interval'='1d')
      
    • range date group by your config

       SELECT online FROM online GROUP BY date_range(field='insert_time','format'='yyyy-MM-dd' ,'2014-08-18','2014-08-17','now-8d','now-7d','now-6d','now')
      
  • ES Geographic

     SELECT * FROM locations WHERE GEO_BOUNDING_BOX(fieldname,100.0,1.0,101,0.0)
    
  • Select type

     SELECT * FROM indexName/type
    

SQL Features

  • SQL Select
  • SQL Delete
  • SQL Where
    • can use "case when" in where clause
  • SQL Order By
    • can use "case when" in order by clause
  • SQL Group By
  • SQL AND & OR
  • SQL Like
  • SQL COUNT distinct
  • SQL In
  • SQL Between
  • SQL Aliases
  • SQL Not Null
  • SQL(ES) Date
  • SQL avg()
  • SQL count()
  • SQL last()
  • SQL max()
  • SQL min()
  • SQL sum()
  • SQL Nulls
  • SQL isnull()
  • SQL now()
  • SQL floor
  • SQL split
  • SQL trim
  • SQL log
  • SQL log10
  • SQL substring
  • SQL round
    • eg: round(10.135, 2) --> 10.14
  • SQL sqrt
  • SQL concat_ws
  • SQL union and minus
  • SQL case when
    • can use "in"、"not in" judge in case when clause
    • can execute simple calculation in case when clause, eg : case when 1 = 1 then field_1 + field_2 else 0 end
  • SQL if
    • select if(sex='1','男','女') from t_user;
  • SQL limit
    • can set aggregation bucket size and shard size by setting limit, shardSize = 20 * bucketSize
    • eg: select city,count(*) as user_count from t_user group by city limit 100;
    • on the above example, the bucket size is 100, shard size is 20*100 = 2000

JDBC Support (Experimental feature)

Check details : JDBC Support

Beyond sql features

  • ES TopHits
  • ES MISSING
  • ES STATS
  • ES GEO_INTERSECTS
  • ES GEO_BOUNDING_BOX
  • ES GEO_DISTANCE
  • ES GEOHASH_GRID aggregation

About

Use SQL to query Elasticsearch

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Add copy buttons to all
 blocks
(function() {
function addCopyButtons() {
document.querySelectorAll('pre code').forEach(function(codeBlock) {
if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;
codeBlock.parentElement.setAttribute('data-copy-added', 'true');
var btn = document.createElement('button');
btn.textContent = 'Copy';
btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';
btn.onmouseover = function() { this.style.opacity = '1'; };
btn.onmouseout = function() { this.style.opacity = '0.7'; };
btn.onclick = function() {
navigator.clipboard.writeText(codeBlock.textContent).then(function() {
btn.textContent = 'Copied!';
setTimeout(function() { btn.textContent = 'Copy'; }, 1500);
});
};
codeBlock.parentElement.style.position = 'relative';
codeBlock.parentElement.appendChild(btn);
});
}
addCopyButtons();
// Re-run on dynamic content
var observer = new MutationObserver(addCopyButtons);
observer.observe(document.body, { childList: true, subtree: true });
})();
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
GitHub - dai-chen/elasticsearch-sql: Use SQL to query Elasticsearch · GitHub
Skip to content

Repository files navigation

DEPRECATED

Please note, this project is no longer in active development, and is deprecated, please use official version x-pack-sql.


Elasticsearch-SQL

build status

1.7.61.7.6 Build Status2.0.02.0.0 Build Status2.1.02.1.0 Build Status2.1.12.1.1 Build Status2.1.22.1.2 Build Status2.2.02.2.0 Build Status
2.2.12.2.1 Build Status2.3.02.3.0 Build Status2.3.12.3.1 Build Status2.3.22.3.2 Build Status2.3.32.3.3 Build Status2.3.42.3.4 Build Status
2.3.52.3.5 Build Status2.4.02.4.0 Build Status2.4.12.4.1 Build Status2.4.22.4.2 Build Status2.4.32.4.3 Build Status2.4.42.4.4 Build Status
2.4.52.4.5 Build Status2.4.62.4.6 Build Status5.0.15.0.1 Build Status5.1.15.1.1 Build Status5.1.25.1.2 Build Status5.2.05.2.0 Build Status
5.2.15.2.1 Build Status5.2.25.2.2 Build Status5.3.05.3.0 Build Status5.3.15.3.1 Build Status5.3.25.3.2 Build Status5.3.35.3.3 Build Status
5.4.05.4.0 Build Status5.4.15.4.1 Build Status5.4.25.4.2 Build Status5.4.35.4.3 Build Status5.5.05.5.0 Build Status5.5.15.5.1 Build Status
5.5.25.5.2 Build Status5.5.35.5.3 Build Status5.6.05.6.0 Build Status5.6.15.6.1 Build Status5.6.25.6.2 Build Status5.6.35.6.3 Build Status
5.6.45.6.4 Build Status5.6.55.6.5 Build Status5.6.65.6.6 Build Status5.6.75.6.7 Build Status5.6.85.6.8 Build Status5.6.95.6.9 Build Status
5.6.105.6.10 Build Status5.6.115.6.11 Build Status5.6.125.6.12 Build Status5.6.135.6.13 Build Status5.6.145.6.14 Build Status5.6.155.6.15 Build Status
5.6.165.6.16 Build Status6.0.06.0.0 Build Status6.0.16.0.1 Build Status6.1.06.1.0 Build Status6.1.16.1.1 Build Status6.1.26.1.2 Build Status
6.1.36.1.3 Build Status6.1.46.1.4 Build Status6.2.06.2.0 Build Status6.2.16.2.1 Build Status6.2.26.2.2 Build Status6.2.36.2.3 Build Status
6.2.46.2.4 Build Status6.3.06.3.0 Build Status6.3.16.3.1 Build Status6.3.26.3.2 Build Status6.4.06.4.0 Build Status6.4.16.4.1 Build Status
6.4.26.4.2 Build Status6.4.36.4.3 Build Status6.5.06.5.0 Build Status6.5.16.5.1 Build Status6.5.26.5.2 Build Status6.5.36.5.3 Build Status
6.5.46.5.4 Build Status6.6.06.6.0 Build Status6.6.16.6.1 Build Status6.6.26.6.2 Build Status6.7.06.7.0 Build Status6.7.16.7.1 Build Status
6.7.26.7.2 Build Status6.8.06.8.0 Build Status6.8.16.8.1 Build Status6.8.26.8.2 Build Status6.8.36.8.3 Build Status6.8.46.8.4 Build Status
7.0.07.0.0 Build Status7.0.17.0.1 Build Status7.1.07.1.0 Build Status7.1.17.1.1 Build Status7.2.07.2.0 Build Status7.2.17.2.1 Build Status
7.3.07.3.0 Build Status7.3.17.3.1 Build Status7.3.27.3.2 Build Status7.4.07.4.0 Build Status7.4.17.4.1 Build Status7.4.27.4.2 Build Status

Query elasticsearch using familiar SQL syntax. You can also use ES functions in SQL.

Check out our wiki!

explain example

you can visite : http://essql.nlpcn.org/ , it is a sample example for explain

Web frontend overview

Web frontend overview

SETUP

Install as plugin: Versions

elasticsearch versionlatest versionremarksbranch
1.x1.7.6tested against elastic 1.7.6elastic1.x
2.0.02.0.4delete commands not supportedelastic2.0
2.1.02.1.0.2delete commands not supportedelastic2.1
2.1.12.1.1.1delete commands not supportedelastic2.1.1
2.1.22.1.2.0delete commands not supportedelastic2.1.2
2.2.02.2.0.1delete commands not supportedelastic2.2.0
2.2.12.2.1.0delete commands not supportedelastic2.2.1
2.3.02.3.0.0delete commands not supportedelastic2.3.0
2.3.12.3.1.1delete commands not supportedelastic2.3.1
2.3.22.3.2.0delete commands not supportedelastic2.3.2
2.3.32.3.3.0delete commands not supportedelastic2.3.3
2.3.42.3.4.0delete commands not supportedelastic2.3.4
2.3.52.3.5.0delete commands not supportedelastic2.3.5
2.4.02.4.0.1delete commands not supportedelastic2.4.0
2.4.12.4.1.0delete commands not supportedelastic2.4.1
2.4.22.4.2.1delete commands not supportedelastic2.4.2
2.4.32.4.3.0delete commands not supportedelastic2.4.3
2.4.42.4.4.0delete commands not supportedelastic2.4.4
2.4.52.4.5.0delete commands not supportedelastic2.4.5
2.4.62.4.6.0delete commands not supportedelastic2.4.6
5.0.15.0.1.0delete commands not supportedelastic5.0.1
5.1.15.1.1.0delete commands not supportedelastic5.1.1
5.1.25.1.2.0delete commands not supportedelastic5.1.2
5.2.05.2.0.0delete commands not supportedelastic5.2.0
5.2.15.2.1.0delete commands not supportedelastic5.2.1
5.2.25.2.2.0delete commands not supportedelastic5.2.2
5.3.05.3.0.0delete commands not supportedelastic5.3.0
5.3.15.3.1.0delete commands not supportedelastic5.3.1
5.3.25.3.2.0delete commands not supportedelastic5.3.2
5.3.35.3.3.0delete commands not supportedelastic5.3.3
5.4.05.4.0.0delete commands not supportedelastic5.4.0
5.4.15.4.1.0delete commands not supportedelastic5.4.1
5.4.25.4.2.0delete commands not supportedelastic5.4.2
5.4.35.4.3.0delete commands not supportedelastic5.4.3
5.5.05.5.0.1delete commands not supportedelastic5.5.0
5.5.15.5.1.0delete commands not supportedelastic5.5.1
5.5.25.5.2.0delete commands not supportedelastic5.5.2
5.5.35.5.3.0delete commands not supportedelastic5.5.3
5.6.05.6.0.0delete commands not supportedelastic5.6.0
5.6.15.6.1.0delete commands not supportedelastic5.6.1
5.6.25.6.2.0delete commands not supportedelastic5.6.2
5.6.35.6.3.0delete commands not supportedelastic5.6.3
5.6.45.6.4.0delete commands not supportedelastic5.6.4
5.6.55.6.5.0delete commands not supportedelastic5.6.5
5.6.65.6.6.0elastic5.6.6
5.6.75.6.7.0elastic5.6.7
5.6.85.6.8.0elastic5.6.8
5.6.95.6.9.0elastic5.6.9
5.6.105.6.10.0elastic5.6.10
5.6.115.6.11.0elastic5.6.11
5.6.125.6.12.0elastic5.6.12
5.6.135.6.13.0elastic5.6.13
5.6.145.6.14.0elastic5.6.14
5.6.155.6.15.0elastic5.6.15
5.6.165.6.16.0elastic5.6.16
6.0.06.0.0.0elastic6.0.0
6.0.16.0.1.0elastic6.0.1
6.1.06.1.0.0elastic6.1.0
6.1.16.1.1.0elastic6.1.1
6.1.26.1.2.0elastic6.1.2
6.1.36.1.3.0elastic6.1.3
6.1.46.1.4.0elastic6.1.4
6.2.06.2.0.0elastic6.2.0
6.2.16.2.1.0elastic6.2.1
6.2.26.2.2.0elastic6.2.2
6.2.36.2.3.0elastic6.2.3
6.2.46.2.4.0elastic6.2.4
6.3.06.3.0.0elastic6.3.0
6.3.16.3.1.0elastic6.3.1
6.3.26.3.2.0elastic6.3.2
6.4.06.4.0.0elastic6.4.0
6.4.16.4.1.0elastic6.4.1
6.4.26.4.2.0elastic6.4.2
6.4.36.4.3.0elastic6.4.3
6.5.06.5.0.0elastic6.5.0
6.5.16.5.1.0elastic6.5.1
6.5.26.5.2.0elastic6.5.2
6.5.36.5.3.0elastic6.5.3
6.5.46.5.4.0elastic6.5.4
6.6.06.6.0.0elastic6.6.0
6.6.16.6.1.0elastic6.6.1
6.6.26.6.2.0elastic6.6.2
6.7.06.7.0.0elastic6.7.0
6.7.16.7.1.0elastic6.7.1
6.7.26.7.2.0elastic6.7.2
6.8.06.8.0.0elastic6.8.0
6.8.16.8.1.0elastic6.8.1
6.8.26.8.2.0elastic6.8.2
6.8.36.8.3.0elastic6.8.3
6.8.46.8.4.0elastic6.8.4
7.0.07.0.0.0elastic7.0.0
7.0.17.0.1.0elastic7.0.1
7.1.07.1.0.0elastic7.1.0
7.1.17.1.1.0elastic7.1.1
7.2.07.2.0.0elastic7.2.0
7.2.17.2.1.0elastic7.2.1
7.3.07.3.0.0elastic7.3.0
7.3.17.3.1.0elastic7.3.1
7.3.27.3.2.0elastic7.3.2
7.4.07.4.0.0elastic7.4.0
7.4.17.4.1.0elastic7.4.1
7.4.27.4.2.0elastic7.4.2

Elasticsearch 1.x

./bin/plugin -u https://github.com/NLPchina/elasticsearch-sql/releases/download/1.7.6/elasticsearch-sql-1.7.6.zip --install sql

Elasticsearch 2.0.0

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.0.4/elasticsearch-sql-2.0.4.zip 

Elasticsearch 2.1.0

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.1.0.2/elasticsearch-sql-2.1.0.2.zip 

Elasticsearch 2.1.1

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.1.1.1/elasticsearch-sql-2.1.1.1.zip 

Elasticsearch 2.1.2

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.1.2.0/elasticsearch-sql-2.1.2.0.zip 

Elasticsearch 2.2.0

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.2.0.1/elasticsearch-sql-2.2.0.1.zip 

Elasticsearch 2.2.1

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.2.1.0/elasticsearch-sql-2.2.1.0.zip 

Elasticsearch 2.3.0

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.3.0.0/elasticsearch-sql-2.3.0.0.zip 

Elasticsearch 2.3.1

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.3.1.1/elasticsearch-sql-2.3.1.1.zip 

Elasticsearch 2.3.2

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.3.2.0/elasticsearch-sql-2.3.2.0.zip 

Elasticsearch 2.3.3

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.3.3.0/elasticsearch-sql-2.3.3.0.zip 

Elasticsearch 2.3.4

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.3.4.0/elasticsearch-sql-2.3.4.0.zip 

Elasticsearch 2.3.5

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.3.5.0/elasticsearch-sql-2.3.5.0.zip 

Elasticsearch 2.4.0

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.4.0.1/elasticsearch-sql-2.4.0.1.zip

Elasticsearch 2.4.1

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.4.1.0/elasticsearch-sql-2.4.1.0.zip

Elasticsearch 2.4.2

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.4.2.1/elasticsearch-sql-2.4.2.1.zip

Elasticsearch 2.4.3

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.4.3.0/elasticsearch-sql-2.4.3.0.zip

Elasticsearch 2.4.4

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.4.4.0/elasticsearch-sql-2.4.4.0.zip

Elasticsearch 2.4.5

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.4.5.0/elasticsearch-sql-2.4.5.0.zip

Elasticsearch 2.4.6

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.4.6.0/elasticsearch-sql-2.4.6.0.zip

Elasticsearch 5.0.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.0.1/elasticsearch-sql-5.0.1.0.zip

Elasticsearch 5.1.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.1.1.0/elasticsearch-sql-5.1.1.0.zip

Elasticsearch 5.1.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.1.2.0/elasticsearch-sql-5.1.2.0.zip

Elasticsearch 5.2.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.2.0.0/elasticsearch-sql-5.2.0.0.zip

Elasticsearch 5.2.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.2.1.0/elasticsearch-sql-5.2.1.0.zip

Elasticsearch 5.2.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.2.2.0/elasticsearch-sql-5.2.2.0.zip

Elasticsearch 5.3.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.3.0.0/elasticsearch-sql-5.3.0.0.zip

Elasticsearch 5.3.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.3.1.0/elasticsearch-sql-5.3.1.0.zip

Elasticsearch 5.3.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.3.2.0/elasticsearch-sql-5.3.2.0.zip

Elasticsearch 5.3.3

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.3.3.0/elasticsearch-sql-5.3.3.0.zip

Elasticsearch 5.4.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.4.0.0/elasticsearch-sql-5.4.0.0.zip

Elasticsearch 5.4.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.4.1.0/elasticsearch-sql-5.4.1.0.zip

Elasticsearch 5.4.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.4.2.0/elasticsearch-sql-5.4.2.0.zip

Elasticsearch 5.4.3

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.4.3.0/elasticsearch-sql-5.4.3.0.zip

Elasticsearch 5.5.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.5.0.0/elasticsearch-sql-5.5.0.1.zip

Elasticsearch 5.5.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.5.1.0/elasticsearch-sql-5.5.1.0.zip

Elasticsearch 5.5.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.5.2.0/elasticsearch-sql-5.5.2.0.zip

Elasticsearch 5.5.3

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.5.3.0/elasticsearch-sql-5.5.3.0.zip

Elasticsearch 5.6.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.0.0/elasticsearch-sql-5.6.0.0.zip

Elasticsearch 5.6.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.1.0/elasticsearch-sql-5.6.1.0.zip

Elasticsearch 5.6.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.2.0/elasticsearch-sql-5.6.2.0.zip

Elasticsearch 5.6.3

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.3.0/elasticsearch-sql-5.6.3.0.zip

Elasticsearch 5.6.4

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.4.0/elasticsearch-sql-5.6.4.0.zip

Elasticsearch 5.6.5

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.5.0/elasticsearch-sql-5.6.5.0.zip

Elasticsearch 5.6.6

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.6.0/elasticsearch-sql-5.6.6.0.zip

Elasticsearch 5.6.7

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.7.0/elasticsearch-sql-5.6.7.0.zip

Elasticsearch 5.6.8

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.8.0/elasticsearch-sql-5.6.8.0.zip

Elasticsearch 5.6.9

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.9.0/elasticsearch-sql-5.6.9.0.zip

Elasticsearch 5.6.10

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.10.0/elasticsearch-sql-5.6.10.0.zip

Elasticsearch 5.6.11

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.11.0/elasticsearch-sql-5.6.11.0.zip

Elasticsearch 5.6.12

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.12.0/elasticsearch-sql-5.6.12.0.zip

Elasticsearch 5.6.13

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.13.0/elasticsearch-sql-5.6.13.0.zip

Elasticsearch 5.6.14

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.14.0/elasticsearch-sql-5.6.14.0.zip

Elasticsearch 5.6.15

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.15.0/elasticsearch-sql-5.6.15.0.zip

Elasticsearch 5.6.16

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.16.0/elasticsearch-sql-5.6.16.0.zip

Elasticsearch 6.0.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.0.0.0/elasticsearch-sql-6.0.0.0.zip

Elasticsearch 6.0.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.0.1.0/elasticsearch-sql-6.0.1.0.zip

Elasticsearch 6.1.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.1.0.0/elasticsearch-sql-6.1.0.0.zip

Elasticsearch 6.1.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.1.1.0/elasticsearch-sql-6.1.1.0.zip

Elasticsearch 6.1.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.1.2.0/elasticsearch-sql-6.1.2.0.zip

Elasticsearch 6.1.3

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.1.3.0/elasticsearch-sql-6.1.3.0.zip

Elasticsearch 6.1.4

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.1.4.0/elasticsearch-sql-6.1.4.0.zip

Elasticsearch 6.2.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.2.0.0/elasticsearch-sql-6.2.0.0.zip

Elasticsearch 6.2.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.2.1.0/elasticsearch-sql-6.2.1.0.zip

Elasticsearch 6.2.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.2.2.0/elasticsearch-sql-6.2.2.0.zip

Elasticsearch 6.2.3

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.2.3.0/elasticsearch-sql-6.2.3.0.zip

Elasticsearch 6.2.4

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.2.4.0/elasticsearch-sql-6.2.4.0.zip

Elasticsearch 6.3.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.3.0.0/elasticsearch-sql-6.3.0.0.zip

Elasticsearch 6.3.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.3.1.0/elasticsearch-sql-6.3.1.1.zip

Elasticsearch 6.3.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.3.2.0/elasticsearch-sql-6.3.2.0.zip

Elasticsearch 6.4.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.4.0.0/elasticsearch-sql-6.4.0.0.zip

Elasticsearch 6.4.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.4.1.0/elasticsearch-sql-6.4.1.0.zip

Elasticsearch 6.4.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.4.2.0/elasticsearch-sql-6.4.2.0.zip

Elasticsearch 6.4.3

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.4.3.0/elasticsearch-sql-6.4.3.0.zip

Elasticsearch 6.5.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.5.0.0/elasticsearch-sql-6.5.0.0.zip

Elasticsearch 6.5.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.5.1.0/elasticsearch-sql-6.5.1.0.zip

Elasticsearch 6.5.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.5.2.0/elasticsearch-sql-6.5.2.0.zip

Elasticsearch 6.5.3

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.5.3.0/elasticsearch-sql-6.5.3.0.zip

Elasticsearch 6.5.4

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.5.4.0/elasticsearch-sql-6.5.4.0.zip

Elasticsearch 6.6.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.6.0.0/elasticsearch-sql-6.6.0.0.zip

Elasticsearch 6.6.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.6.1.0/elasticsearch-sql-6.6.1.0.zip

Elasticsearch 6.6.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.6.2.0/elasticsearch-sql-6.6.2.0.zip

Elasticsearch 6.7.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.7.0.0/elasticsearch-sql-6.7.0.0.zip

Elasticsearch 6.7.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.7.1.0/elasticsearch-sql-6.7.1.0.zip

Elasticsearch 6.7.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.7.2.0/elasticsearch-sql-6.7.2.0.zip

Elasticsearch 6.8.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.8.0.0/elasticsearch-sql-6.8.0.0.zip

Elasticsearch 6.8.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.8.1.0/elasticsearch-sql-6.8.1.0.zip

Elasticsearch 6.8.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.8.2.0/elasticsearch-sql-6.8.2.0.zip

Elasticsearch 6.8.3

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.8.3.0/elasticsearch-sql-6.8.3.0.zip

Elasticsearch 6.8.4

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.8.4.0/elasticsearch-sql-6.8.4.0.zip

Elasticsearch 7.0.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.0.0.0/elasticsearch-sql-7.0.0.0.zip

Elasticsearch 7.0.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.0.1.0/elasticsearch-sql-7.0.1.0.zip

Elasticsearch 7.1.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.1.0.0/elasticsearch-sql-7.1.0.0.zip

Elasticsearch 7.1.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.1.1.0/elasticsearch-sql-7.1.1.0.zip

Elasticsearch 7.2.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.2.0.0/elasticsearch-sql-7.2.0.0.zip

Elasticsearch 7.2.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.2.1.0/elasticsearch-sql-7.2.1.0.zip

Elasticsearch 7.3.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.3.0.0/elasticsearch-sql-7.3.0.0.zip

Elasticsearch 7.3.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.3.1.0/elasticsearch-sql-7.3.1.0.zip

Elasticsearch 7.3.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.3.2.0/elasticsearch-sql-7.3.2.0.zip

Elasticsearch 7.4.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.4.0.0/elasticsearch-sql-7.4.0.0.zip

Elasticsearch 7.4.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.4.1.0/elasticsearch-sql-7.4.1.0.zip

Elasticsearch 7.4.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.4.2.0/elasticsearch-sql-7.4.2.0.zip

After doing this, you need to restart the Elasticsearch server. Otherwise you may get errors like Invalid index name [sql], must not start with '']; ","status":400}.

Basic Usage

On elasticsearch 1.x / 2.x, visit the elasticsearch-sql web front-end:

http://localhost:9200/_plugin/sql/

On elasticsearch 5.x/6.x, use elasticsearch sql site chrome extension (make sure to enable cors on elasticsearch.yml). Alternatively, download and extract site, then start the web front-end like this:

cd site-server
npm install express --save
node node-server.js 
  • Simple query
curl -X GET "localhost:9200/_sql" -H 'Content-Type: application/json' -d'select * from indexName limit 10'
  • Explain SQL to elasticsearch query DSL
curl -X GET "localhost:9200/_sql/_explain" -H 'Content-Type: application/json' -d'select * from indexName limit 10'

SQL Usage

  • Query

     SELECT * FROM bank WHERE age >30 AND gender = 'm'
    
  • Aggregation

     select COUNT(*),SUM(age),MIN(age) as m, MAX(age),AVG(age)
    FROM bank GROUP BY gender ORDER BY SUM(age), m DESC
    
  • Delete

     DELETE FROM bank WHERE age >30 AND gender = 'm'
    

Beyond SQL

  • Search

     SELECT address FROM bank WHERE address = matchQuery('880 Holmes Lane') ORDER BY _score DESC LIMIT 3
    
  • Aggregations

    • range age group 20-25,25-30,30-35,35-40

       SELECT COUNT(age) FROM bank GROUP BY range(age, 20,25,30,35,40)
      
    • range date group by day

       SELECT online FROM online GROUP BY date_histogram(field='insert_time','interval'='1d')
      
    • range date group by your config

       SELECT online FROM online GROUP BY date_range(field='insert_time','format'='yyyy-MM-dd' ,'2014-08-18','2014-08-17','now-8d','now-7d','now-6d','now')
      
  • ES Geographic

     SELECT * FROM locations WHERE GEO_BOUNDING_BOX(fieldname,100.0,1.0,101,0.0)
    
  • Select type

     SELECT * FROM indexName/type
    

SQL Features

  • SQL Select
  • SQL Delete
  • SQL Where
    • can use "case when" in where clause
  • SQL Order By
    • can use "case when" in order by clause
  • SQL Group By
  • SQL AND & OR
  • SQL Like
  • SQL COUNT distinct
  • SQL In
  • SQL Between
  • SQL Aliases
  • SQL Not Null
  • SQL(ES) Date
  • SQL avg()
  • SQL count()
  • SQL last()
  • SQL max()
  • SQL min()
  • SQL sum()
  • SQL Nulls
  • SQL isnull()
  • SQL now()
  • SQL floor
  • SQL split
  • SQL trim
  • SQL log
  • SQL log10
  • SQL substring
  • SQL round
    • eg: round(10.135, 2) --> 10.14
  • SQL sqrt
  • SQL concat_ws
  • SQL union and minus
  • SQL case when
    • can use "in"、"not in" judge in case when clause
    • can execute simple calculation in case when clause, eg : case when 1 = 1 then field_1 + field_2 else 0 end
  • SQL if
    • select if(sex='1','男','女') from t_user;
  • SQL limit
    • can set aggregation bucket size and shard size by setting limit, shardSize = 20 * bucketSize
    • eg: select city,count(*) as user_count from t_user group by city limit 100;
    • on the above example, the bucket size is 100, shard size is 20*100 = 2000

JDBC Support (Experimental feature)

Check details : JDBC Support

Beyond sql features

  • ES TopHits
  • ES MISSING
  • ES STATS
  • ES GEO_INTERSECTS
  • ES GEO_BOUNDING_BOX
  • ES GEO_DISTANCE
  • ES GEOHASH_GRID aggregation

About

Use SQL to query Elasticsearch

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Force GitHub README to respect dark mode (function() { var style = document.createElement('style'); style.textContent = ' .markdown-body { color-scheme: dark light; } .markdown-body pre { background: #161b22 !important; } .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; } .markdown-body table th, .markdown-body table td { border-color: #30363d !important; } .markdown-body img { background: #0d1117; } .markdown-body blockquote { border-left-color: #8b949e; } .markdown-body hr { border-color: #30363d; } '; document.head.appendChild(style); })(); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' GitHub - dai-chen/elasticsearch-sql: Use SQL to query Elasticsearch · GitHub
Skip to content

Repository files navigation

DEPRECATED

Please note, this project is no longer in active development, and is deprecated, please use official version x-pack-sql.


Elasticsearch-SQL

build status

1.7.61.7.6 Build Status2.0.02.0.0 Build Status2.1.02.1.0 Build Status2.1.12.1.1 Build Status2.1.22.1.2 Build Status2.2.02.2.0 Build Status
2.2.12.2.1 Build Status2.3.02.3.0 Build Status2.3.12.3.1 Build Status2.3.22.3.2 Build Status2.3.32.3.3 Build Status2.3.42.3.4 Build Status
2.3.52.3.5 Build Status2.4.02.4.0 Build Status2.4.12.4.1 Build Status2.4.22.4.2 Build Status2.4.32.4.3 Build Status2.4.42.4.4 Build Status
2.4.52.4.5 Build Status2.4.62.4.6 Build Status5.0.15.0.1 Build Status5.1.15.1.1 Build Status5.1.25.1.2 Build Status5.2.05.2.0 Build Status
5.2.15.2.1 Build Status5.2.25.2.2 Build Status5.3.05.3.0 Build Status5.3.15.3.1 Build Status5.3.25.3.2 Build Status5.3.35.3.3 Build Status
5.4.05.4.0 Build Status5.4.15.4.1 Build Status5.4.25.4.2 Build Status5.4.35.4.3 Build Status5.5.05.5.0 Build Status5.5.15.5.1 Build Status
5.5.25.5.2 Build Status5.5.35.5.3 Build Status5.6.05.6.0 Build Status5.6.15.6.1 Build Status5.6.25.6.2 Build Status5.6.35.6.3 Build Status
5.6.45.6.4 Build Status5.6.55.6.5 Build Status5.6.65.6.6 Build Status5.6.75.6.7 Build Status5.6.85.6.8 Build Status5.6.95.6.9 Build Status
5.6.105.6.10 Build Status5.6.115.6.11 Build Status5.6.125.6.12 Build Status5.6.135.6.13 Build Status5.6.145.6.14 Build Status5.6.155.6.15 Build Status
5.6.165.6.16 Build Status6.0.06.0.0 Build Status6.0.16.0.1 Build Status6.1.06.1.0 Build Status6.1.16.1.1 Build Status6.1.26.1.2 Build Status
6.1.36.1.3 Build Status6.1.46.1.4 Build Status6.2.06.2.0 Build Status6.2.16.2.1 Build Status6.2.26.2.2 Build Status6.2.36.2.3 Build Status
6.2.46.2.4 Build Status6.3.06.3.0 Build Status6.3.16.3.1 Build Status6.3.26.3.2 Build Status6.4.06.4.0 Build Status6.4.16.4.1 Build Status
6.4.26.4.2 Build Status6.4.36.4.3 Build Status6.5.06.5.0 Build Status6.5.16.5.1 Build Status6.5.26.5.2 Build Status6.5.36.5.3 Build Status
6.5.46.5.4 Build Status6.6.06.6.0 Build Status6.6.16.6.1 Build Status6.6.26.6.2 Build Status6.7.06.7.0 Build Status6.7.16.7.1 Build Status
6.7.26.7.2 Build Status6.8.06.8.0 Build Status6.8.16.8.1 Build Status6.8.26.8.2 Build Status6.8.36.8.3 Build Status6.8.46.8.4 Build Status
7.0.07.0.0 Build Status7.0.17.0.1 Build Status7.1.07.1.0 Build Status7.1.17.1.1 Build Status7.2.07.2.0 Build Status7.2.17.2.1 Build Status
7.3.07.3.0 Build Status7.3.17.3.1 Build Status7.3.27.3.2 Build Status7.4.07.4.0 Build Status7.4.17.4.1 Build Status7.4.27.4.2 Build Status

Query elasticsearch using familiar SQL syntax. You can also use ES functions in SQL.

Check out our wiki!

explain example

you can visite : http://essql.nlpcn.org/ , it is a sample example for explain

Web frontend overview

Web frontend overview

SETUP

Install as plugin: Versions

elasticsearch versionlatest versionremarksbranch
1.x1.7.6tested against elastic 1.7.6elastic1.x
2.0.02.0.4delete commands not supportedelastic2.0
2.1.02.1.0.2delete commands not supportedelastic2.1
2.1.12.1.1.1delete commands not supportedelastic2.1.1
2.1.22.1.2.0delete commands not supportedelastic2.1.2
2.2.02.2.0.1delete commands not supportedelastic2.2.0
2.2.12.2.1.0delete commands not supportedelastic2.2.1
2.3.02.3.0.0delete commands not supportedelastic2.3.0
2.3.12.3.1.1delete commands not supportedelastic2.3.1
2.3.22.3.2.0delete commands not supportedelastic2.3.2
2.3.32.3.3.0delete commands not supportedelastic2.3.3
2.3.42.3.4.0delete commands not supportedelastic2.3.4
2.3.52.3.5.0delete commands not supportedelastic2.3.5
2.4.02.4.0.1delete commands not supportedelastic2.4.0
2.4.12.4.1.0delete commands not supportedelastic2.4.1
2.4.22.4.2.1delete commands not supportedelastic2.4.2
2.4.32.4.3.0delete commands not supportedelastic2.4.3
2.4.42.4.4.0delete commands not supportedelastic2.4.4
2.4.52.4.5.0delete commands not supportedelastic2.4.5
2.4.62.4.6.0delete commands not supportedelastic2.4.6
5.0.15.0.1.0delete commands not supportedelastic5.0.1
5.1.15.1.1.0delete commands not supportedelastic5.1.1
5.1.25.1.2.0delete commands not supportedelastic5.1.2
5.2.05.2.0.0delete commands not supportedelastic5.2.0
5.2.15.2.1.0delete commands not supportedelastic5.2.1
5.2.25.2.2.0delete commands not supportedelastic5.2.2
5.3.05.3.0.0delete commands not supportedelastic5.3.0
5.3.15.3.1.0delete commands not supportedelastic5.3.1
5.3.25.3.2.0delete commands not supportedelastic5.3.2
5.3.35.3.3.0delete commands not supportedelastic5.3.3
5.4.05.4.0.0delete commands not supportedelastic5.4.0
5.4.15.4.1.0delete commands not supportedelastic5.4.1
5.4.25.4.2.0delete commands not supportedelastic5.4.2
5.4.35.4.3.0delete commands not supportedelastic5.4.3
5.5.05.5.0.1delete commands not supportedelastic5.5.0
5.5.15.5.1.0delete commands not supportedelastic5.5.1
5.5.25.5.2.0delete commands not supportedelastic5.5.2
5.5.35.5.3.0delete commands not supportedelastic5.5.3
5.6.05.6.0.0delete commands not supportedelastic5.6.0
5.6.15.6.1.0delete commands not supportedelastic5.6.1
5.6.25.6.2.0delete commands not supportedelastic5.6.2
5.6.35.6.3.0delete commands not supportedelastic5.6.3
5.6.45.6.4.0delete commands not supportedelastic5.6.4
5.6.55.6.5.0delete commands not supportedelastic5.6.5
5.6.65.6.6.0elastic5.6.6
5.6.75.6.7.0elastic5.6.7
5.6.85.6.8.0elastic5.6.8
5.6.95.6.9.0elastic5.6.9
5.6.105.6.10.0elastic5.6.10
5.6.115.6.11.0elastic5.6.11
5.6.125.6.12.0elastic5.6.12
5.6.135.6.13.0elastic5.6.13
5.6.145.6.14.0elastic5.6.14
5.6.155.6.15.0elastic5.6.15
5.6.165.6.16.0elastic5.6.16
6.0.06.0.0.0elastic6.0.0
6.0.16.0.1.0elastic6.0.1
6.1.06.1.0.0elastic6.1.0
6.1.16.1.1.0elastic6.1.1
6.1.26.1.2.0elastic6.1.2
6.1.36.1.3.0elastic6.1.3
6.1.46.1.4.0elastic6.1.4
6.2.06.2.0.0elastic6.2.0
6.2.16.2.1.0elastic6.2.1
6.2.26.2.2.0elastic6.2.2
6.2.36.2.3.0elastic6.2.3
6.2.46.2.4.0elastic6.2.4
6.3.06.3.0.0elastic6.3.0
6.3.16.3.1.0elastic6.3.1
6.3.26.3.2.0elastic6.3.2
6.4.06.4.0.0elastic6.4.0
6.4.16.4.1.0elastic6.4.1
6.4.26.4.2.0elastic6.4.2
6.4.36.4.3.0elastic6.4.3
6.5.06.5.0.0elastic6.5.0
6.5.16.5.1.0elastic6.5.1
6.5.26.5.2.0elastic6.5.2
6.5.36.5.3.0elastic6.5.3
6.5.46.5.4.0elastic6.5.4
6.6.06.6.0.0elastic6.6.0
6.6.16.6.1.0elastic6.6.1
6.6.26.6.2.0elastic6.6.2
6.7.06.7.0.0elastic6.7.0
6.7.16.7.1.0elastic6.7.1
6.7.26.7.2.0elastic6.7.2
6.8.06.8.0.0elastic6.8.0
6.8.16.8.1.0elastic6.8.1
6.8.26.8.2.0elastic6.8.2
6.8.36.8.3.0elastic6.8.3
6.8.46.8.4.0elastic6.8.4
7.0.07.0.0.0elastic7.0.0
7.0.17.0.1.0elastic7.0.1
7.1.07.1.0.0elastic7.1.0
7.1.17.1.1.0elastic7.1.1
7.2.07.2.0.0elastic7.2.0
7.2.17.2.1.0elastic7.2.1
7.3.07.3.0.0elastic7.3.0
7.3.17.3.1.0elastic7.3.1
7.3.27.3.2.0elastic7.3.2
7.4.07.4.0.0elastic7.4.0
7.4.17.4.1.0elastic7.4.1
7.4.27.4.2.0elastic7.4.2

Elasticsearch 1.x

./bin/plugin -u https://github.com/NLPchina/elasticsearch-sql/releases/download/1.7.6/elasticsearch-sql-1.7.6.zip --install sql

Elasticsearch 2.0.0

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.0.4/elasticsearch-sql-2.0.4.zip 

Elasticsearch 2.1.0

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.1.0.2/elasticsearch-sql-2.1.0.2.zip 

Elasticsearch 2.1.1

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.1.1.1/elasticsearch-sql-2.1.1.1.zip 

Elasticsearch 2.1.2

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.1.2.0/elasticsearch-sql-2.1.2.0.zip 

Elasticsearch 2.2.0

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.2.0.1/elasticsearch-sql-2.2.0.1.zip 

Elasticsearch 2.2.1

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.2.1.0/elasticsearch-sql-2.2.1.0.zip 

Elasticsearch 2.3.0

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.3.0.0/elasticsearch-sql-2.3.0.0.zip 

Elasticsearch 2.3.1

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.3.1.1/elasticsearch-sql-2.3.1.1.zip 

Elasticsearch 2.3.2

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.3.2.0/elasticsearch-sql-2.3.2.0.zip 

Elasticsearch 2.3.3

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.3.3.0/elasticsearch-sql-2.3.3.0.zip 

Elasticsearch 2.3.4

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.3.4.0/elasticsearch-sql-2.3.4.0.zip 

Elasticsearch 2.3.5

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.3.5.0/elasticsearch-sql-2.3.5.0.zip 

Elasticsearch 2.4.0

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.4.0.1/elasticsearch-sql-2.4.0.1.zip

Elasticsearch 2.4.1

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.4.1.0/elasticsearch-sql-2.4.1.0.zip

Elasticsearch 2.4.2

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.4.2.1/elasticsearch-sql-2.4.2.1.zip

Elasticsearch 2.4.3

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.4.3.0/elasticsearch-sql-2.4.3.0.zip

Elasticsearch 2.4.4

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.4.4.0/elasticsearch-sql-2.4.4.0.zip

Elasticsearch 2.4.5

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.4.5.0/elasticsearch-sql-2.4.5.0.zip

Elasticsearch 2.4.6

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.4.6.0/elasticsearch-sql-2.4.6.0.zip

Elasticsearch 5.0.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.0.1/elasticsearch-sql-5.0.1.0.zip

Elasticsearch 5.1.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.1.1.0/elasticsearch-sql-5.1.1.0.zip

Elasticsearch 5.1.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.1.2.0/elasticsearch-sql-5.1.2.0.zip

Elasticsearch 5.2.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.2.0.0/elasticsearch-sql-5.2.0.0.zip

Elasticsearch 5.2.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.2.1.0/elasticsearch-sql-5.2.1.0.zip

Elasticsearch 5.2.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.2.2.0/elasticsearch-sql-5.2.2.0.zip

Elasticsearch 5.3.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.3.0.0/elasticsearch-sql-5.3.0.0.zip

Elasticsearch 5.3.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.3.1.0/elasticsearch-sql-5.3.1.0.zip

Elasticsearch 5.3.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.3.2.0/elasticsearch-sql-5.3.2.0.zip

Elasticsearch 5.3.3

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.3.3.0/elasticsearch-sql-5.3.3.0.zip

Elasticsearch 5.4.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.4.0.0/elasticsearch-sql-5.4.0.0.zip

Elasticsearch 5.4.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.4.1.0/elasticsearch-sql-5.4.1.0.zip

Elasticsearch 5.4.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.4.2.0/elasticsearch-sql-5.4.2.0.zip

Elasticsearch 5.4.3

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.4.3.0/elasticsearch-sql-5.4.3.0.zip

Elasticsearch 5.5.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.5.0.0/elasticsearch-sql-5.5.0.1.zip

Elasticsearch 5.5.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.5.1.0/elasticsearch-sql-5.5.1.0.zip

Elasticsearch 5.5.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.5.2.0/elasticsearch-sql-5.5.2.0.zip

Elasticsearch 5.5.3

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.5.3.0/elasticsearch-sql-5.5.3.0.zip

Elasticsearch 5.6.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.0.0/elasticsearch-sql-5.6.0.0.zip

Elasticsearch 5.6.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.1.0/elasticsearch-sql-5.6.1.0.zip

Elasticsearch 5.6.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.2.0/elasticsearch-sql-5.6.2.0.zip

Elasticsearch 5.6.3

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.3.0/elasticsearch-sql-5.6.3.0.zip

Elasticsearch 5.6.4

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.4.0/elasticsearch-sql-5.6.4.0.zip

Elasticsearch 5.6.5

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.5.0/elasticsearch-sql-5.6.5.0.zip

Elasticsearch 5.6.6

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.6.0/elasticsearch-sql-5.6.6.0.zip

Elasticsearch 5.6.7

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.7.0/elasticsearch-sql-5.6.7.0.zip

Elasticsearch 5.6.8

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.8.0/elasticsearch-sql-5.6.8.0.zip

Elasticsearch 5.6.9

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.9.0/elasticsearch-sql-5.6.9.0.zip

Elasticsearch 5.6.10

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.10.0/elasticsearch-sql-5.6.10.0.zip

Elasticsearch 5.6.11

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.11.0/elasticsearch-sql-5.6.11.0.zip

Elasticsearch 5.6.12

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.12.0/elasticsearch-sql-5.6.12.0.zip

Elasticsearch 5.6.13

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.13.0/elasticsearch-sql-5.6.13.0.zip

Elasticsearch 5.6.14

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.14.0/elasticsearch-sql-5.6.14.0.zip

Elasticsearch 5.6.15

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.15.0/elasticsearch-sql-5.6.15.0.zip

Elasticsearch 5.6.16

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.16.0/elasticsearch-sql-5.6.16.0.zip

Elasticsearch 6.0.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.0.0.0/elasticsearch-sql-6.0.0.0.zip

Elasticsearch 6.0.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.0.1.0/elasticsearch-sql-6.0.1.0.zip

Elasticsearch 6.1.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.1.0.0/elasticsearch-sql-6.1.0.0.zip

Elasticsearch 6.1.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.1.1.0/elasticsearch-sql-6.1.1.0.zip

Elasticsearch 6.1.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.1.2.0/elasticsearch-sql-6.1.2.0.zip

Elasticsearch 6.1.3

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.1.3.0/elasticsearch-sql-6.1.3.0.zip

Elasticsearch 6.1.4

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.1.4.0/elasticsearch-sql-6.1.4.0.zip

Elasticsearch 6.2.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.2.0.0/elasticsearch-sql-6.2.0.0.zip

Elasticsearch 6.2.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.2.1.0/elasticsearch-sql-6.2.1.0.zip

Elasticsearch 6.2.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.2.2.0/elasticsearch-sql-6.2.2.0.zip

Elasticsearch 6.2.3

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.2.3.0/elasticsearch-sql-6.2.3.0.zip

Elasticsearch 6.2.4

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.2.4.0/elasticsearch-sql-6.2.4.0.zip

Elasticsearch 6.3.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.3.0.0/elasticsearch-sql-6.3.0.0.zip

Elasticsearch 6.3.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.3.1.0/elasticsearch-sql-6.3.1.1.zip

Elasticsearch 6.3.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.3.2.0/elasticsearch-sql-6.3.2.0.zip

Elasticsearch 6.4.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.4.0.0/elasticsearch-sql-6.4.0.0.zip

Elasticsearch 6.4.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.4.1.0/elasticsearch-sql-6.4.1.0.zip

Elasticsearch 6.4.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.4.2.0/elasticsearch-sql-6.4.2.0.zip

Elasticsearch 6.4.3

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.4.3.0/elasticsearch-sql-6.4.3.0.zip

Elasticsearch 6.5.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.5.0.0/elasticsearch-sql-6.5.0.0.zip

Elasticsearch 6.5.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.5.1.0/elasticsearch-sql-6.5.1.0.zip

Elasticsearch 6.5.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.5.2.0/elasticsearch-sql-6.5.2.0.zip

Elasticsearch 6.5.3

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.5.3.0/elasticsearch-sql-6.5.3.0.zip

Elasticsearch 6.5.4

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.5.4.0/elasticsearch-sql-6.5.4.0.zip

Elasticsearch 6.6.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.6.0.0/elasticsearch-sql-6.6.0.0.zip

Elasticsearch 6.6.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.6.1.0/elasticsearch-sql-6.6.1.0.zip

Elasticsearch 6.6.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.6.2.0/elasticsearch-sql-6.6.2.0.zip

Elasticsearch 6.7.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.7.0.0/elasticsearch-sql-6.7.0.0.zip

Elasticsearch 6.7.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.7.1.0/elasticsearch-sql-6.7.1.0.zip

Elasticsearch 6.7.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.7.2.0/elasticsearch-sql-6.7.2.0.zip

Elasticsearch 6.8.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.8.0.0/elasticsearch-sql-6.8.0.0.zip

Elasticsearch 6.8.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.8.1.0/elasticsearch-sql-6.8.1.0.zip

Elasticsearch 6.8.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.8.2.0/elasticsearch-sql-6.8.2.0.zip

Elasticsearch 6.8.3

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.8.3.0/elasticsearch-sql-6.8.3.0.zip

Elasticsearch 6.8.4

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.8.4.0/elasticsearch-sql-6.8.4.0.zip

Elasticsearch 7.0.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.0.0.0/elasticsearch-sql-7.0.0.0.zip

Elasticsearch 7.0.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.0.1.0/elasticsearch-sql-7.0.1.0.zip

Elasticsearch 7.1.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.1.0.0/elasticsearch-sql-7.1.0.0.zip

Elasticsearch 7.1.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.1.1.0/elasticsearch-sql-7.1.1.0.zip

Elasticsearch 7.2.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.2.0.0/elasticsearch-sql-7.2.0.0.zip

Elasticsearch 7.2.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.2.1.0/elasticsearch-sql-7.2.1.0.zip

Elasticsearch 7.3.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.3.0.0/elasticsearch-sql-7.3.0.0.zip

Elasticsearch 7.3.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.3.1.0/elasticsearch-sql-7.3.1.0.zip

Elasticsearch 7.3.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.3.2.0/elasticsearch-sql-7.3.2.0.zip

Elasticsearch 7.4.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.4.0.0/elasticsearch-sql-7.4.0.0.zip

Elasticsearch 7.4.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.4.1.0/elasticsearch-sql-7.4.1.0.zip

Elasticsearch 7.4.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.4.2.0/elasticsearch-sql-7.4.2.0.zip

After doing this, you need to restart the Elasticsearch server. Otherwise you may get errors like Invalid index name [sql], must not start with '']; ","status":400}.

Basic Usage

On elasticsearch 1.x / 2.x, visit the elasticsearch-sql web front-end:

http://localhost:9200/_plugin/sql/

On elasticsearch 5.x/6.x, use elasticsearch sql site chrome extension (make sure to enable cors on elasticsearch.yml). Alternatively, download and extract site, then start the web front-end like this:

cd site-server
npm install express --save
node node-server.js 
  • Simple query
curl -X GET "localhost:9200/_sql" -H 'Content-Type: application/json' -d'select * from indexName limit 10'
  • Explain SQL to elasticsearch query DSL
curl -X GET "localhost:9200/_sql/_explain" -H 'Content-Type: application/json' -d'select * from indexName limit 10'

SQL Usage

  • Query

     SELECT * FROM bank WHERE age >30 AND gender = 'm'
    
  • Aggregation

     select COUNT(*),SUM(age),MIN(age) as m, MAX(age),AVG(age)
    FROM bank GROUP BY gender ORDER BY SUM(age), m DESC
    
  • Delete

     DELETE FROM bank WHERE age >30 AND gender = 'm'
    

Beyond SQL

  • Search

     SELECT address FROM bank WHERE address = matchQuery('880 Holmes Lane') ORDER BY _score DESC LIMIT 3
    
  • Aggregations

    • range age group 20-25,25-30,30-35,35-40

       SELECT COUNT(age) FROM bank GROUP BY range(age, 20,25,30,35,40)
      
    • range date group by day

       SELECT online FROM online GROUP BY date_histogram(field='insert_time','interval'='1d')
      
    • range date group by your config

       SELECT online FROM online GROUP BY date_range(field='insert_time','format'='yyyy-MM-dd' ,'2014-08-18','2014-08-17','now-8d','now-7d','now-6d','now')
      
  • ES Geographic

     SELECT * FROM locations WHERE GEO_BOUNDING_BOX(fieldname,100.0,1.0,101,0.0)
    
  • Select type

     SELECT * FROM indexName/type
    

SQL Features

  • SQL Select
  • SQL Delete
  • SQL Where
    • can use "case when" in where clause
  • SQL Order By
    • can use "case when" in order by clause
  • SQL Group By
  • SQL AND & OR
  • SQL Like
  • SQL COUNT distinct
  • SQL In
  • SQL Between
  • SQL Aliases
  • SQL Not Null
  • SQL(ES) Date
  • SQL avg()
  • SQL count()
  • SQL last()
  • SQL max()
  • SQL min()
  • SQL sum()
  • SQL Nulls
  • SQL isnull()
  • SQL now()
  • SQL floor
  • SQL split
  • SQL trim
  • SQL log
  • SQL log10
  • SQL substring
  • SQL round
    • eg: round(10.135, 2) --> 10.14
  • SQL sqrt
  • SQL concat_ws
  • SQL union and minus
  • SQL case when
    • can use "in"、"not in" judge in case when clause
    • can execute simple calculation in case when clause, eg : case when 1 = 1 then field_1 + field_2 else 0 end
  • SQL if
    • select if(sex='1','男','女') from t_user;
  • SQL limit
    • can set aggregation bucket size and shard size by setting limit, shardSize = 20 * bucketSize
    • eg: select city,count(*) as user_count from t_user group by city limit 100;
    • on the above example, the bucket size is 100, shard size is 20*100 = 2000

JDBC Support (Experimental feature)

Check details : JDBC Support

Beyond sql features

  • ES TopHits
  • ES MISSING
  • ES STATS
  • ES GEO_INTERSECTS
  • ES GEO_BOUNDING_BOX
  • ES GEO_DISTANCE
  • ES GEOHASH_GRID aggregation

About

Use SQL to query Elasticsearch

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Highlight search terms from Google/DuckDuckGo/Bing referrer (function() { var ref = document.referrer; var terms = []; if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) { var url = new URL(ref); var q = url.searchParams.get('q') || url.searchParams.get('p'); if (q) { terms = q.split(/\s+/).filter(function(t) { return t.length > 2; }); } } if (terms.length === 0) return; var style = document.createElement('style'); style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }'; document.head.appendChild(style); function highlight(node) { if (node.nodeType === 3) { // text node var text = node.textContent; var found = false; terms.forEach(function(term) { var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\]\\]/g, '\\') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' GitHub - dai-chen/elasticsearch-sql: Use SQL to query Elasticsearch · GitHub
Skip to content

Repository files navigation

DEPRECATED

Please note, this project is no longer in active development, and is deprecated, please use official version x-pack-sql.


Elasticsearch-SQL

build status

1.7.61.7.6 Build Status2.0.02.0.0 Build Status2.1.02.1.0 Build Status2.1.12.1.1 Build Status2.1.22.1.2 Build Status2.2.02.2.0 Build Status
2.2.12.2.1 Build Status2.3.02.3.0 Build Status2.3.12.3.1 Build Status2.3.22.3.2 Build Status2.3.32.3.3 Build Status2.3.42.3.4 Build Status
2.3.52.3.5 Build Status2.4.02.4.0 Build Status2.4.12.4.1 Build Status2.4.22.4.2 Build Status2.4.32.4.3 Build Status2.4.42.4.4 Build Status
2.4.52.4.5 Build Status2.4.62.4.6 Build Status5.0.15.0.1 Build Status5.1.15.1.1 Build Status5.1.25.1.2 Build Status5.2.05.2.0 Build Status
5.2.15.2.1 Build Status5.2.25.2.2 Build Status5.3.05.3.0 Build Status5.3.15.3.1 Build Status5.3.25.3.2 Build Status5.3.35.3.3 Build Status
5.4.05.4.0 Build Status5.4.15.4.1 Build Status5.4.25.4.2 Build Status5.4.35.4.3 Build Status5.5.05.5.0 Build Status5.5.15.5.1 Build Status
5.5.25.5.2 Build Status5.5.35.5.3 Build Status5.6.05.6.0 Build Status5.6.15.6.1 Build Status5.6.25.6.2 Build Status5.6.35.6.3 Build Status
5.6.45.6.4 Build Status5.6.55.6.5 Build Status5.6.65.6.6 Build Status5.6.75.6.7 Build Status5.6.85.6.8 Build Status5.6.95.6.9 Build Status
5.6.105.6.10 Build Status5.6.115.6.11 Build Status5.6.125.6.12 Build Status5.6.135.6.13 Build Status5.6.145.6.14 Build Status5.6.155.6.15 Build Status
5.6.165.6.16 Build Status6.0.06.0.0 Build Status6.0.16.0.1 Build Status6.1.06.1.0 Build Status6.1.16.1.1 Build Status6.1.26.1.2 Build Status
6.1.36.1.3 Build Status6.1.46.1.4 Build Status6.2.06.2.0 Build Status6.2.16.2.1 Build Status6.2.26.2.2 Build Status6.2.36.2.3 Build Status
6.2.46.2.4 Build Status6.3.06.3.0 Build Status6.3.16.3.1 Build Status6.3.26.3.2 Build Status6.4.06.4.0 Build Status6.4.16.4.1 Build Status
6.4.26.4.2 Build Status6.4.36.4.3 Build Status6.5.06.5.0 Build Status6.5.16.5.1 Build Status6.5.26.5.2 Build Status6.5.36.5.3 Build Status
6.5.46.5.4 Build Status6.6.06.6.0 Build Status6.6.16.6.1 Build Status6.6.26.6.2 Build Status6.7.06.7.0 Build Status6.7.16.7.1 Build Status
6.7.26.7.2 Build Status6.8.06.8.0 Build Status6.8.16.8.1 Build Status6.8.26.8.2 Build Status6.8.36.8.3 Build Status6.8.46.8.4 Build Status
7.0.07.0.0 Build Status7.0.17.0.1 Build Status7.1.07.1.0 Build Status7.1.17.1.1 Build Status7.2.07.2.0 Build Status7.2.17.2.1 Build Status
7.3.07.3.0 Build Status7.3.17.3.1 Build Status7.3.27.3.2 Build Status7.4.07.4.0 Build Status7.4.17.4.1 Build Status7.4.27.4.2 Build Status

Query elasticsearch using familiar SQL syntax. You can also use ES functions in SQL.

Check out our wiki!

explain example

you can visite : http://essql.nlpcn.org/ , it is a sample example for explain

Web frontend overview

Web frontend overview

SETUP

Install as plugin: Versions

elasticsearch versionlatest versionremarksbranch
1.x1.7.6tested against elastic 1.7.6elastic1.x
2.0.02.0.4delete commands not supportedelastic2.0
2.1.02.1.0.2delete commands not supportedelastic2.1
2.1.12.1.1.1delete commands not supportedelastic2.1.1
2.1.22.1.2.0delete commands not supportedelastic2.1.2
2.2.02.2.0.1delete commands not supportedelastic2.2.0
2.2.12.2.1.0delete commands not supportedelastic2.2.1
2.3.02.3.0.0delete commands not supportedelastic2.3.0
2.3.12.3.1.1delete commands not supportedelastic2.3.1
2.3.22.3.2.0delete commands not supportedelastic2.3.2
2.3.32.3.3.0delete commands not supportedelastic2.3.3
2.3.42.3.4.0delete commands not supportedelastic2.3.4
2.3.52.3.5.0delete commands not supportedelastic2.3.5
2.4.02.4.0.1delete commands not supportedelastic2.4.0
2.4.12.4.1.0delete commands not supportedelastic2.4.1
2.4.22.4.2.1delete commands not supportedelastic2.4.2
2.4.32.4.3.0delete commands not supportedelastic2.4.3
2.4.42.4.4.0delete commands not supportedelastic2.4.4
2.4.52.4.5.0delete commands not supportedelastic2.4.5
2.4.62.4.6.0delete commands not supportedelastic2.4.6
5.0.15.0.1.0delete commands not supportedelastic5.0.1
5.1.15.1.1.0delete commands not supportedelastic5.1.1
5.1.25.1.2.0delete commands not supportedelastic5.1.2
5.2.05.2.0.0delete commands not supportedelastic5.2.0
5.2.15.2.1.0delete commands not supportedelastic5.2.1
5.2.25.2.2.0delete commands not supportedelastic5.2.2
5.3.05.3.0.0delete commands not supportedelastic5.3.0
5.3.15.3.1.0delete commands not supportedelastic5.3.1
5.3.25.3.2.0delete commands not supportedelastic5.3.2
5.3.35.3.3.0delete commands not supportedelastic5.3.3
5.4.05.4.0.0delete commands not supportedelastic5.4.0
5.4.15.4.1.0delete commands not supportedelastic5.4.1
5.4.25.4.2.0delete commands not supportedelastic5.4.2
5.4.35.4.3.0delete commands not supportedelastic5.4.3
5.5.05.5.0.1delete commands not supportedelastic5.5.0
5.5.15.5.1.0delete commands not supportedelastic5.5.1
5.5.25.5.2.0delete commands not supportedelastic5.5.2
5.5.35.5.3.0delete commands not supportedelastic5.5.3
5.6.05.6.0.0delete commands not supportedelastic5.6.0
5.6.15.6.1.0delete commands not supportedelastic5.6.1
5.6.25.6.2.0delete commands not supportedelastic5.6.2
5.6.35.6.3.0delete commands not supportedelastic5.6.3
5.6.45.6.4.0delete commands not supportedelastic5.6.4
5.6.55.6.5.0delete commands not supportedelastic5.6.5
5.6.65.6.6.0elastic5.6.6
5.6.75.6.7.0elastic5.6.7
5.6.85.6.8.0elastic5.6.8
5.6.95.6.9.0elastic5.6.9
5.6.105.6.10.0elastic5.6.10
5.6.115.6.11.0elastic5.6.11
5.6.125.6.12.0elastic5.6.12
5.6.135.6.13.0elastic5.6.13
5.6.145.6.14.0elastic5.6.14
5.6.155.6.15.0elastic5.6.15
5.6.165.6.16.0elastic5.6.16
6.0.06.0.0.0elastic6.0.0
6.0.16.0.1.0elastic6.0.1
6.1.06.1.0.0elastic6.1.0
6.1.16.1.1.0elastic6.1.1
6.1.26.1.2.0elastic6.1.2
6.1.36.1.3.0elastic6.1.3
6.1.46.1.4.0elastic6.1.4
6.2.06.2.0.0elastic6.2.0
6.2.16.2.1.0elastic6.2.1
6.2.26.2.2.0elastic6.2.2
6.2.36.2.3.0elastic6.2.3
6.2.46.2.4.0elastic6.2.4
6.3.06.3.0.0elastic6.3.0
6.3.16.3.1.0elastic6.3.1
6.3.26.3.2.0elastic6.3.2
6.4.06.4.0.0elastic6.4.0
6.4.16.4.1.0elastic6.4.1
6.4.26.4.2.0elastic6.4.2
6.4.36.4.3.0elastic6.4.3
6.5.06.5.0.0elastic6.5.0
6.5.16.5.1.0elastic6.5.1
6.5.26.5.2.0elastic6.5.2
6.5.36.5.3.0elastic6.5.3
6.5.46.5.4.0elastic6.5.4
6.6.06.6.0.0elastic6.6.0
6.6.16.6.1.0elastic6.6.1
6.6.26.6.2.0elastic6.6.2
6.7.06.7.0.0elastic6.7.0
6.7.16.7.1.0elastic6.7.1
6.7.26.7.2.0elastic6.7.2
6.8.06.8.0.0elastic6.8.0
6.8.16.8.1.0elastic6.8.1
6.8.26.8.2.0elastic6.8.2
6.8.36.8.3.0elastic6.8.3
6.8.46.8.4.0elastic6.8.4
7.0.07.0.0.0elastic7.0.0
7.0.17.0.1.0elastic7.0.1
7.1.07.1.0.0elastic7.1.0
7.1.17.1.1.0elastic7.1.1
7.2.07.2.0.0elastic7.2.0
7.2.17.2.1.0elastic7.2.1
7.3.07.3.0.0elastic7.3.0
7.3.17.3.1.0elastic7.3.1
7.3.27.3.2.0elastic7.3.2
7.4.07.4.0.0elastic7.4.0
7.4.17.4.1.0elastic7.4.1
7.4.27.4.2.0elastic7.4.2

Elasticsearch 1.x

./bin/plugin -u https://github.com/NLPchina/elasticsearch-sql/releases/download/1.7.6/elasticsearch-sql-1.7.6.zip --install sql

Elasticsearch 2.0.0

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.0.4/elasticsearch-sql-2.0.4.zip 

Elasticsearch 2.1.0

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.1.0.2/elasticsearch-sql-2.1.0.2.zip 

Elasticsearch 2.1.1

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.1.1.1/elasticsearch-sql-2.1.1.1.zip 

Elasticsearch 2.1.2

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.1.2.0/elasticsearch-sql-2.1.2.0.zip 

Elasticsearch 2.2.0

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.2.0.1/elasticsearch-sql-2.2.0.1.zip 

Elasticsearch 2.2.1

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.2.1.0/elasticsearch-sql-2.2.1.0.zip 

Elasticsearch 2.3.0

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.3.0.0/elasticsearch-sql-2.3.0.0.zip 

Elasticsearch 2.3.1

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.3.1.1/elasticsearch-sql-2.3.1.1.zip 

Elasticsearch 2.3.2

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.3.2.0/elasticsearch-sql-2.3.2.0.zip 

Elasticsearch 2.3.3

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.3.3.0/elasticsearch-sql-2.3.3.0.zip 

Elasticsearch 2.3.4

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.3.4.0/elasticsearch-sql-2.3.4.0.zip 

Elasticsearch 2.3.5

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.3.5.0/elasticsearch-sql-2.3.5.0.zip 

Elasticsearch 2.4.0

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.4.0.1/elasticsearch-sql-2.4.0.1.zip

Elasticsearch 2.4.1

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.4.1.0/elasticsearch-sql-2.4.1.0.zip

Elasticsearch 2.4.2

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.4.2.1/elasticsearch-sql-2.4.2.1.zip

Elasticsearch 2.4.3

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.4.3.0/elasticsearch-sql-2.4.3.0.zip

Elasticsearch 2.4.4

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.4.4.0/elasticsearch-sql-2.4.4.0.zip

Elasticsearch 2.4.5

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.4.5.0/elasticsearch-sql-2.4.5.0.zip

Elasticsearch 2.4.6

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.4.6.0/elasticsearch-sql-2.4.6.0.zip

Elasticsearch 5.0.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.0.1/elasticsearch-sql-5.0.1.0.zip

Elasticsearch 5.1.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.1.1.0/elasticsearch-sql-5.1.1.0.zip

Elasticsearch 5.1.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.1.2.0/elasticsearch-sql-5.1.2.0.zip

Elasticsearch 5.2.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.2.0.0/elasticsearch-sql-5.2.0.0.zip

Elasticsearch 5.2.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.2.1.0/elasticsearch-sql-5.2.1.0.zip

Elasticsearch 5.2.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.2.2.0/elasticsearch-sql-5.2.2.0.zip

Elasticsearch 5.3.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.3.0.0/elasticsearch-sql-5.3.0.0.zip

Elasticsearch 5.3.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.3.1.0/elasticsearch-sql-5.3.1.0.zip

Elasticsearch 5.3.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.3.2.0/elasticsearch-sql-5.3.2.0.zip

Elasticsearch 5.3.3

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.3.3.0/elasticsearch-sql-5.3.3.0.zip

Elasticsearch 5.4.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.4.0.0/elasticsearch-sql-5.4.0.0.zip

Elasticsearch 5.4.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.4.1.0/elasticsearch-sql-5.4.1.0.zip

Elasticsearch 5.4.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.4.2.0/elasticsearch-sql-5.4.2.0.zip

Elasticsearch 5.4.3

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.4.3.0/elasticsearch-sql-5.4.3.0.zip

Elasticsearch 5.5.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.5.0.0/elasticsearch-sql-5.5.0.1.zip

Elasticsearch 5.5.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.5.1.0/elasticsearch-sql-5.5.1.0.zip

Elasticsearch 5.5.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.5.2.0/elasticsearch-sql-5.5.2.0.zip

Elasticsearch 5.5.3

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.5.3.0/elasticsearch-sql-5.5.3.0.zip

Elasticsearch 5.6.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.0.0/elasticsearch-sql-5.6.0.0.zip

Elasticsearch 5.6.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.1.0/elasticsearch-sql-5.6.1.0.zip

Elasticsearch 5.6.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.2.0/elasticsearch-sql-5.6.2.0.zip

Elasticsearch 5.6.3

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.3.0/elasticsearch-sql-5.6.3.0.zip

Elasticsearch 5.6.4

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.4.0/elasticsearch-sql-5.6.4.0.zip

Elasticsearch 5.6.5

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.5.0/elasticsearch-sql-5.6.5.0.zip

Elasticsearch 5.6.6

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.6.0/elasticsearch-sql-5.6.6.0.zip

Elasticsearch 5.6.7

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.7.0/elasticsearch-sql-5.6.7.0.zip

Elasticsearch 5.6.8

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.8.0/elasticsearch-sql-5.6.8.0.zip

Elasticsearch 5.6.9

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.9.0/elasticsearch-sql-5.6.9.0.zip

Elasticsearch 5.6.10

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.10.0/elasticsearch-sql-5.6.10.0.zip

Elasticsearch 5.6.11

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.11.0/elasticsearch-sql-5.6.11.0.zip

Elasticsearch 5.6.12

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.12.0/elasticsearch-sql-5.6.12.0.zip

Elasticsearch 5.6.13

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.13.0/elasticsearch-sql-5.6.13.0.zip

Elasticsearch 5.6.14

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.14.0/elasticsearch-sql-5.6.14.0.zip

Elasticsearch 5.6.15

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.15.0/elasticsearch-sql-5.6.15.0.zip

Elasticsearch 5.6.16

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.16.0/elasticsearch-sql-5.6.16.0.zip

Elasticsearch 6.0.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.0.0.0/elasticsearch-sql-6.0.0.0.zip

Elasticsearch 6.0.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.0.1.0/elasticsearch-sql-6.0.1.0.zip

Elasticsearch 6.1.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.1.0.0/elasticsearch-sql-6.1.0.0.zip

Elasticsearch 6.1.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.1.1.0/elasticsearch-sql-6.1.1.0.zip

Elasticsearch 6.1.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.1.2.0/elasticsearch-sql-6.1.2.0.zip

Elasticsearch 6.1.3

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.1.3.0/elasticsearch-sql-6.1.3.0.zip

Elasticsearch 6.1.4

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.1.4.0/elasticsearch-sql-6.1.4.0.zip

Elasticsearch 6.2.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.2.0.0/elasticsearch-sql-6.2.0.0.zip

Elasticsearch 6.2.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.2.1.0/elasticsearch-sql-6.2.1.0.zip

Elasticsearch 6.2.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.2.2.0/elasticsearch-sql-6.2.2.0.zip

Elasticsearch 6.2.3

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.2.3.0/elasticsearch-sql-6.2.3.0.zip

Elasticsearch 6.2.4

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.2.4.0/elasticsearch-sql-6.2.4.0.zip

Elasticsearch 6.3.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.3.0.0/elasticsearch-sql-6.3.0.0.zip

Elasticsearch 6.3.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.3.1.0/elasticsearch-sql-6.3.1.1.zip

Elasticsearch 6.3.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.3.2.0/elasticsearch-sql-6.3.2.0.zip

Elasticsearch 6.4.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.4.0.0/elasticsearch-sql-6.4.0.0.zip

Elasticsearch 6.4.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.4.1.0/elasticsearch-sql-6.4.1.0.zip

Elasticsearch 6.4.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.4.2.0/elasticsearch-sql-6.4.2.0.zip

Elasticsearch 6.4.3

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.4.3.0/elasticsearch-sql-6.4.3.0.zip

Elasticsearch 6.5.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.5.0.0/elasticsearch-sql-6.5.0.0.zip

Elasticsearch 6.5.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.5.1.0/elasticsearch-sql-6.5.1.0.zip

Elasticsearch 6.5.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.5.2.0/elasticsearch-sql-6.5.2.0.zip

Elasticsearch 6.5.3

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.5.3.0/elasticsearch-sql-6.5.3.0.zip

Elasticsearch 6.5.4

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.5.4.0/elasticsearch-sql-6.5.4.0.zip

Elasticsearch 6.6.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.6.0.0/elasticsearch-sql-6.6.0.0.zip

Elasticsearch 6.6.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.6.1.0/elasticsearch-sql-6.6.1.0.zip

Elasticsearch 6.6.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.6.2.0/elasticsearch-sql-6.6.2.0.zip

Elasticsearch 6.7.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.7.0.0/elasticsearch-sql-6.7.0.0.zip

Elasticsearch 6.7.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.7.1.0/elasticsearch-sql-6.7.1.0.zip

Elasticsearch 6.7.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.7.2.0/elasticsearch-sql-6.7.2.0.zip

Elasticsearch 6.8.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.8.0.0/elasticsearch-sql-6.8.0.0.zip

Elasticsearch 6.8.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.8.1.0/elasticsearch-sql-6.8.1.0.zip

Elasticsearch 6.8.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.8.2.0/elasticsearch-sql-6.8.2.0.zip

Elasticsearch 6.8.3

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.8.3.0/elasticsearch-sql-6.8.3.0.zip

Elasticsearch 6.8.4

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.8.4.0/elasticsearch-sql-6.8.4.0.zip

Elasticsearch 7.0.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.0.0.0/elasticsearch-sql-7.0.0.0.zip

Elasticsearch 7.0.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.0.1.0/elasticsearch-sql-7.0.1.0.zip

Elasticsearch 7.1.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.1.0.0/elasticsearch-sql-7.1.0.0.zip

Elasticsearch 7.1.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.1.1.0/elasticsearch-sql-7.1.1.0.zip

Elasticsearch 7.2.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.2.0.0/elasticsearch-sql-7.2.0.0.zip

Elasticsearch 7.2.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.2.1.0/elasticsearch-sql-7.2.1.0.zip

Elasticsearch 7.3.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.3.0.0/elasticsearch-sql-7.3.0.0.zip

Elasticsearch 7.3.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.3.1.0/elasticsearch-sql-7.3.1.0.zip

Elasticsearch 7.3.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.3.2.0/elasticsearch-sql-7.3.2.0.zip

Elasticsearch 7.4.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.4.0.0/elasticsearch-sql-7.4.0.0.zip

Elasticsearch 7.4.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.4.1.0/elasticsearch-sql-7.4.1.0.zip

Elasticsearch 7.4.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.4.2.0/elasticsearch-sql-7.4.2.0.zip

After doing this, you need to restart the Elasticsearch server. Otherwise you may get errors like Invalid index name [sql], must not start with '']; ","status":400}.

Basic Usage

On elasticsearch 1.x / 2.x, visit the elasticsearch-sql web front-end:

http://localhost:9200/_plugin/sql/

On elasticsearch 5.x/6.x, use elasticsearch sql site chrome extension (make sure to enable cors on elasticsearch.yml). Alternatively, download and extract site, then start the web front-end like this:

cd site-server
npm install express --save
node node-server.js 
  • Simple query
curl -X GET "localhost:9200/_sql" -H 'Content-Type: application/json' -d'select * from indexName limit 10'
  • Explain SQL to elasticsearch query DSL
curl -X GET "localhost:9200/_sql/_explain" -H 'Content-Type: application/json' -d'select * from indexName limit 10'

SQL Usage

  • Query

     SELECT * FROM bank WHERE age >30 AND gender = 'm'
    
  • Aggregation

     select COUNT(*),SUM(age),MIN(age) as m, MAX(age),AVG(age)
    FROM bank GROUP BY gender ORDER BY SUM(age), m DESC
    
  • Delete

     DELETE FROM bank WHERE age >30 AND gender = 'm'
    

Beyond SQL

  • Search

     SELECT address FROM bank WHERE address = matchQuery('880 Holmes Lane') ORDER BY _score DESC LIMIT 3
    
  • Aggregations

    • range age group 20-25,25-30,30-35,35-40

       SELECT COUNT(age) FROM bank GROUP BY range(age, 20,25,30,35,40)
      
    • range date group by day

       SELECT online FROM online GROUP BY date_histogram(field='insert_time','interval'='1d')
      
    • range date group by your config

       SELECT online FROM online GROUP BY date_range(field='insert_time','format'='yyyy-MM-dd' ,'2014-08-18','2014-08-17','now-8d','now-7d','now-6d','now')
      
  • ES Geographic

     SELECT * FROM locations WHERE GEO_BOUNDING_BOX(fieldname,100.0,1.0,101,0.0)
    
  • Select type

     SELECT * FROM indexName/type
    

SQL Features

  • SQL Select
  • SQL Delete
  • SQL Where
    • can use "case when" in where clause
  • SQL Order By
    • can use "case when" in order by clause
  • SQL Group By
  • SQL AND & OR
  • SQL Like
  • SQL COUNT distinct
  • SQL In
  • SQL Between
  • SQL Aliases
  • SQL Not Null
  • SQL(ES) Date
  • SQL avg()
  • SQL count()
  • SQL last()
  • SQL max()
  • SQL min()
  • SQL sum()
  • SQL Nulls
  • SQL isnull()
  • SQL now()
  • SQL floor
  • SQL split
  • SQL trim
  • SQL log
  • SQL log10
  • SQL substring
  • SQL round
    • eg: round(10.135, 2) --> 10.14
  • SQL sqrt
  • SQL concat_ws
  • SQL union and minus
  • SQL case when
    • can use "in"、"not in" judge in case when clause
    • can execute simple calculation in case when clause, eg : case when 1 = 1 then field_1 + field_2 else 0 end
  • SQL if
    • select if(sex='1','男','女') from t_user;
  • SQL limit
    • can set aggregation bucket size and shard size by setting limit, shardSize = 20 * bucketSize
    • eg: select city,count(*) as user_count from t_user group by city limit 100;
    • on the above example, the bucket size is 100, shard size is 20*100 = 2000

JDBC Support (Experimental feature)

Check details : JDBC Support

Beyond sql features

  • ES TopHits
  • ES MISSING
  • ES STATS
  • ES GEO_INTERSECTS
  • ES GEO_BOUNDING_BOX
  • ES GEO_DISTANCE
  • ES GEOHASH_GRID aggregation

About

Use SQL to query Elasticsearch

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + ' GitHub - dai-chen/elasticsearch-sql: Use SQL to query Elasticsearch · GitHub
Skip to content

Repository files navigation

DEPRECATED

Please note, this project is no longer in active development, and is deprecated, please use official version x-pack-sql.


Elasticsearch-SQL

build status

1.7.61.7.6 Build Status2.0.02.0.0 Build Status2.1.02.1.0 Build Status2.1.12.1.1 Build Status2.1.22.1.2 Build Status2.2.02.2.0 Build Status
2.2.12.2.1 Build Status2.3.02.3.0 Build Status2.3.12.3.1 Build Status2.3.22.3.2 Build Status2.3.32.3.3 Build Status2.3.42.3.4 Build Status
2.3.52.3.5 Build Status2.4.02.4.0 Build Status2.4.12.4.1 Build Status2.4.22.4.2 Build Status2.4.32.4.3 Build Status2.4.42.4.4 Build Status
2.4.52.4.5 Build Status2.4.62.4.6 Build Status5.0.15.0.1 Build Status5.1.15.1.1 Build Status5.1.25.1.2 Build Status5.2.05.2.0 Build Status
5.2.15.2.1 Build Status5.2.25.2.2 Build Status5.3.05.3.0 Build Status5.3.15.3.1 Build Status5.3.25.3.2 Build Status5.3.35.3.3 Build Status
5.4.05.4.0 Build Status5.4.15.4.1 Build Status5.4.25.4.2 Build Status5.4.35.4.3 Build Status5.5.05.5.0 Build Status5.5.15.5.1 Build Status
5.5.25.5.2 Build Status5.5.35.5.3 Build Status5.6.05.6.0 Build Status5.6.15.6.1 Build Status5.6.25.6.2 Build Status5.6.35.6.3 Build Status
5.6.45.6.4 Build Status5.6.55.6.5 Build Status5.6.65.6.6 Build Status5.6.75.6.7 Build Status5.6.85.6.8 Build Status5.6.95.6.9 Build Status
5.6.105.6.10 Build Status5.6.115.6.11 Build Status5.6.125.6.12 Build Status5.6.135.6.13 Build Status5.6.145.6.14 Build Status5.6.155.6.15 Build Status
5.6.165.6.16 Build Status6.0.06.0.0 Build Status6.0.16.0.1 Build Status6.1.06.1.0 Build Status6.1.16.1.1 Build Status6.1.26.1.2 Build Status
6.1.36.1.3 Build Status6.1.46.1.4 Build Status6.2.06.2.0 Build Status6.2.16.2.1 Build Status6.2.26.2.2 Build Status6.2.36.2.3 Build Status
6.2.46.2.4 Build Status6.3.06.3.0 Build Status6.3.16.3.1 Build Status6.3.26.3.2 Build Status6.4.06.4.0 Build Status6.4.16.4.1 Build Status
6.4.26.4.2 Build Status6.4.36.4.3 Build Status6.5.06.5.0 Build Status6.5.16.5.1 Build Status6.5.26.5.2 Build Status6.5.36.5.3 Build Status
6.5.46.5.4 Build Status6.6.06.6.0 Build Status6.6.16.6.1 Build Status6.6.26.6.2 Build Status6.7.06.7.0 Build Status6.7.16.7.1 Build Status
6.7.26.7.2 Build Status6.8.06.8.0 Build Status6.8.16.8.1 Build Status6.8.26.8.2 Build Status6.8.36.8.3 Build Status6.8.46.8.4 Build Status
7.0.07.0.0 Build Status7.0.17.0.1 Build Status7.1.07.1.0 Build Status7.1.17.1.1 Build Status7.2.07.2.0 Build Status7.2.17.2.1 Build Status
7.3.07.3.0 Build Status7.3.17.3.1 Build Status7.3.27.3.2 Build Status7.4.07.4.0 Build Status7.4.17.4.1 Build Status7.4.27.4.2 Build Status

Query elasticsearch using familiar SQL syntax. You can also use ES functions in SQL.

Check out our wiki!

explain example

you can visite : http://essql.nlpcn.org/ , it is a sample example for explain

Web frontend overview

Web frontend overview

SETUP

Install as plugin: Versions

elasticsearch versionlatest versionremarksbranch
1.x1.7.6tested against elastic 1.7.6elastic1.x
2.0.02.0.4delete commands not supportedelastic2.0
2.1.02.1.0.2delete commands not supportedelastic2.1
2.1.12.1.1.1delete commands not supportedelastic2.1.1
2.1.22.1.2.0delete commands not supportedelastic2.1.2
2.2.02.2.0.1delete commands not supportedelastic2.2.0
2.2.12.2.1.0delete commands not supportedelastic2.2.1
2.3.02.3.0.0delete commands not supportedelastic2.3.0
2.3.12.3.1.1delete commands not supportedelastic2.3.1
2.3.22.3.2.0delete commands not supportedelastic2.3.2
2.3.32.3.3.0delete commands not supportedelastic2.3.3
2.3.42.3.4.0delete commands not supportedelastic2.3.4
2.3.52.3.5.0delete commands not supportedelastic2.3.5
2.4.02.4.0.1delete commands not supportedelastic2.4.0
2.4.12.4.1.0delete commands not supportedelastic2.4.1
2.4.22.4.2.1delete commands not supportedelastic2.4.2
2.4.32.4.3.0delete commands not supportedelastic2.4.3
2.4.42.4.4.0delete commands not supportedelastic2.4.4
2.4.52.4.5.0delete commands not supportedelastic2.4.5
2.4.62.4.6.0delete commands not supportedelastic2.4.6
5.0.15.0.1.0delete commands not supportedelastic5.0.1
5.1.15.1.1.0delete commands not supportedelastic5.1.1
5.1.25.1.2.0delete commands not supportedelastic5.1.2
5.2.05.2.0.0delete commands not supportedelastic5.2.0
5.2.15.2.1.0delete commands not supportedelastic5.2.1
5.2.25.2.2.0delete commands not supportedelastic5.2.2
5.3.05.3.0.0delete commands not supportedelastic5.3.0
5.3.15.3.1.0delete commands not supportedelastic5.3.1
5.3.25.3.2.0delete commands not supportedelastic5.3.2
5.3.35.3.3.0delete commands not supportedelastic5.3.3
5.4.05.4.0.0delete commands not supportedelastic5.4.0
5.4.15.4.1.0delete commands not supportedelastic5.4.1
5.4.25.4.2.0delete commands not supportedelastic5.4.2
5.4.35.4.3.0delete commands not supportedelastic5.4.3
5.5.05.5.0.1delete commands not supportedelastic5.5.0
5.5.15.5.1.0delete commands not supportedelastic5.5.1
5.5.25.5.2.0delete commands not supportedelastic5.5.2
5.5.35.5.3.0delete commands not supportedelastic5.5.3
5.6.05.6.0.0delete commands not supportedelastic5.6.0
5.6.15.6.1.0delete commands not supportedelastic5.6.1
5.6.25.6.2.0delete commands not supportedelastic5.6.2
5.6.35.6.3.0delete commands not supportedelastic5.6.3
5.6.45.6.4.0delete commands not supportedelastic5.6.4
5.6.55.6.5.0delete commands not supportedelastic5.6.5
5.6.65.6.6.0elastic5.6.6
5.6.75.6.7.0elastic5.6.7
5.6.85.6.8.0elastic5.6.8
5.6.95.6.9.0elastic5.6.9
5.6.105.6.10.0elastic5.6.10
5.6.115.6.11.0elastic5.6.11
5.6.125.6.12.0elastic5.6.12
5.6.135.6.13.0elastic5.6.13
5.6.145.6.14.0elastic5.6.14
5.6.155.6.15.0elastic5.6.15
5.6.165.6.16.0elastic5.6.16
6.0.06.0.0.0elastic6.0.0
6.0.16.0.1.0elastic6.0.1
6.1.06.1.0.0elastic6.1.0
6.1.16.1.1.0elastic6.1.1
6.1.26.1.2.0elastic6.1.2
6.1.36.1.3.0elastic6.1.3
6.1.46.1.4.0elastic6.1.4
6.2.06.2.0.0elastic6.2.0
6.2.16.2.1.0elastic6.2.1
6.2.26.2.2.0elastic6.2.2
6.2.36.2.3.0elastic6.2.3
6.2.46.2.4.0elastic6.2.4
6.3.06.3.0.0elastic6.3.0
6.3.16.3.1.0elastic6.3.1
6.3.26.3.2.0elastic6.3.2
6.4.06.4.0.0elastic6.4.0
6.4.16.4.1.0elastic6.4.1
6.4.26.4.2.0elastic6.4.2
6.4.36.4.3.0elastic6.4.3
6.5.06.5.0.0elastic6.5.0
6.5.16.5.1.0elastic6.5.1
6.5.26.5.2.0elastic6.5.2
6.5.36.5.3.0elastic6.5.3
6.5.46.5.4.0elastic6.5.4
6.6.06.6.0.0elastic6.6.0
6.6.16.6.1.0elastic6.6.1
6.6.26.6.2.0elastic6.6.2
6.7.06.7.0.0elastic6.7.0
6.7.16.7.1.0elastic6.7.1
6.7.26.7.2.0elastic6.7.2
6.8.06.8.0.0elastic6.8.0
6.8.16.8.1.0elastic6.8.1
6.8.26.8.2.0elastic6.8.2
6.8.36.8.3.0elastic6.8.3
6.8.46.8.4.0elastic6.8.4
7.0.07.0.0.0elastic7.0.0
7.0.17.0.1.0elastic7.0.1
7.1.07.1.0.0elastic7.1.0
7.1.17.1.1.0elastic7.1.1
7.2.07.2.0.0elastic7.2.0
7.2.17.2.1.0elastic7.2.1
7.3.07.3.0.0elastic7.3.0
7.3.17.3.1.0elastic7.3.1
7.3.27.3.2.0elastic7.3.2
7.4.07.4.0.0elastic7.4.0
7.4.17.4.1.0elastic7.4.1
7.4.27.4.2.0elastic7.4.2

Elasticsearch 1.x

./bin/plugin -u https://github.com/NLPchina/elasticsearch-sql/releases/download/1.7.6/elasticsearch-sql-1.7.6.zip --install sql

Elasticsearch 2.0.0

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.0.4/elasticsearch-sql-2.0.4.zip 

Elasticsearch 2.1.0

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.1.0.2/elasticsearch-sql-2.1.0.2.zip 

Elasticsearch 2.1.1

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.1.1.1/elasticsearch-sql-2.1.1.1.zip 

Elasticsearch 2.1.2

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.1.2.0/elasticsearch-sql-2.1.2.0.zip 

Elasticsearch 2.2.0

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.2.0.1/elasticsearch-sql-2.2.0.1.zip 

Elasticsearch 2.2.1

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.2.1.0/elasticsearch-sql-2.2.1.0.zip 

Elasticsearch 2.3.0

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.3.0.0/elasticsearch-sql-2.3.0.0.zip 

Elasticsearch 2.3.1

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.3.1.1/elasticsearch-sql-2.3.1.1.zip 

Elasticsearch 2.3.2

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.3.2.0/elasticsearch-sql-2.3.2.0.zip 

Elasticsearch 2.3.3

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.3.3.0/elasticsearch-sql-2.3.3.0.zip 

Elasticsearch 2.3.4

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.3.4.0/elasticsearch-sql-2.3.4.0.zip 

Elasticsearch 2.3.5

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.3.5.0/elasticsearch-sql-2.3.5.0.zip 

Elasticsearch 2.4.0

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.4.0.1/elasticsearch-sql-2.4.0.1.zip

Elasticsearch 2.4.1

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.4.1.0/elasticsearch-sql-2.4.1.0.zip

Elasticsearch 2.4.2

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.4.2.1/elasticsearch-sql-2.4.2.1.zip

Elasticsearch 2.4.3

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.4.3.0/elasticsearch-sql-2.4.3.0.zip

Elasticsearch 2.4.4

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.4.4.0/elasticsearch-sql-2.4.4.0.zip

Elasticsearch 2.4.5

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.4.5.0/elasticsearch-sql-2.4.5.0.zip

Elasticsearch 2.4.6

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.4.6.0/elasticsearch-sql-2.4.6.0.zip

Elasticsearch 5.0.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.0.1/elasticsearch-sql-5.0.1.0.zip

Elasticsearch 5.1.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.1.1.0/elasticsearch-sql-5.1.1.0.zip

Elasticsearch 5.1.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.1.2.0/elasticsearch-sql-5.1.2.0.zip

Elasticsearch 5.2.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.2.0.0/elasticsearch-sql-5.2.0.0.zip

Elasticsearch 5.2.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.2.1.0/elasticsearch-sql-5.2.1.0.zip

Elasticsearch 5.2.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.2.2.0/elasticsearch-sql-5.2.2.0.zip

Elasticsearch 5.3.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.3.0.0/elasticsearch-sql-5.3.0.0.zip

Elasticsearch 5.3.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.3.1.0/elasticsearch-sql-5.3.1.0.zip

Elasticsearch 5.3.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.3.2.0/elasticsearch-sql-5.3.2.0.zip

Elasticsearch 5.3.3

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.3.3.0/elasticsearch-sql-5.3.3.0.zip

Elasticsearch 5.4.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.4.0.0/elasticsearch-sql-5.4.0.0.zip

Elasticsearch 5.4.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.4.1.0/elasticsearch-sql-5.4.1.0.zip

Elasticsearch 5.4.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.4.2.0/elasticsearch-sql-5.4.2.0.zip

Elasticsearch 5.4.3

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.4.3.0/elasticsearch-sql-5.4.3.0.zip

Elasticsearch 5.5.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.5.0.0/elasticsearch-sql-5.5.0.1.zip

Elasticsearch 5.5.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.5.1.0/elasticsearch-sql-5.5.1.0.zip

Elasticsearch 5.5.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.5.2.0/elasticsearch-sql-5.5.2.0.zip

Elasticsearch 5.5.3

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.5.3.0/elasticsearch-sql-5.5.3.0.zip

Elasticsearch 5.6.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.0.0/elasticsearch-sql-5.6.0.0.zip

Elasticsearch 5.6.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.1.0/elasticsearch-sql-5.6.1.0.zip

Elasticsearch 5.6.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.2.0/elasticsearch-sql-5.6.2.0.zip

Elasticsearch 5.6.3

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.3.0/elasticsearch-sql-5.6.3.0.zip

Elasticsearch 5.6.4

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.4.0/elasticsearch-sql-5.6.4.0.zip

Elasticsearch 5.6.5

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.5.0/elasticsearch-sql-5.6.5.0.zip

Elasticsearch 5.6.6

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.6.0/elasticsearch-sql-5.6.6.0.zip

Elasticsearch 5.6.7

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.7.0/elasticsearch-sql-5.6.7.0.zip

Elasticsearch 5.6.8

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.8.0/elasticsearch-sql-5.6.8.0.zip

Elasticsearch 5.6.9

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.9.0/elasticsearch-sql-5.6.9.0.zip

Elasticsearch 5.6.10

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.10.0/elasticsearch-sql-5.6.10.0.zip

Elasticsearch 5.6.11

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.11.0/elasticsearch-sql-5.6.11.0.zip

Elasticsearch 5.6.12

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.12.0/elasticsearch-sql-5.6.12.0.zip

Elasticsearch 5.6.13

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.13.0/elasticsearch-sql-5.6.13.0.zip

Elasticsearch 5.6.14

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.14.0/elasticsearch-sql-5.6.14.0.zip

Elasticsearch 5.6.15

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.15.0/elasticsearch-sql-5.6.15.0.zip

Elasticsearch 5.6.16

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.16.0/elasticsearch-sql-5.6.16.0.zip

Elasticsearch 6.0.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.0.0.0/elasticsearch-sql-6.0.0.0.zip

Elasticsearch 6.0.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.0.1.0/elasticsearch-sql-6.0.1.0.zip

Elasticsearch 6.1.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.1.0.0/elasticsearch-sql-6.1.0.0.zip

Elasticsearch 6.1.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.1.1.0/elasticsearch-sql-6.1.1.0.zip

Elasticsearch 6.1.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.1.2.0/elasticsearch-sql-6.1.2.0.zip

Elasticsearch 6.1.3

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.1.3.0/elasticsearch-sql-6.1.3.0.zip

Elasticsearch 6.1.4

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.1.4.0/elasticsearch-sql-6.1.4.0.zip

Elasticsearch 6.2.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.2.0.0/elasticsearch-sql-6.2.0.0.zip

Elasticsearch 6.2.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.2.1.0/elasticsearch-sql-6.2.1.0.zip

Elasticsearch 6.2.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.2.2.0/elasticsearch-sql-6.2.2.0.zip

Elasticsearch 6.2.3

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.2.3.0/elasticsearch-sql-6.2.3.0.zip

Elasticsearch 6.2.4

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.2.4.0/elasticsearch-sql-6.2.4.0.zip

Elasticsearch 6.3.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.3.0.0/elasticsearch-sql-6.3.0.0.zip

Elasticsearch 6.3.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.3.1.0/elasticsearch-sql-6.3.1.1.zip

Elasticsearch 6.3.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.3.2.0/elasticsearch-sql-6.3.2.0.zip

Elasticsearch 6.4.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.4.0.0/elasticsearch-sql-6.4.0.0.zip

Elasticsearch 6.4.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.4.1.0/elasticsearch-sql-6.4.1.0.zip

Elasticsearch 6.4.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.4.2.0/elasticsearch-sql-6.4.2.0.zip

Elasticsearch 6.4.3

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.4.3.0/elasticsearch-sql-6.4.3.0.zip

Elasticsearch 6.5.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.5.0.0/elasticsearch-sql-6.5.0.0.zip

Elasticsearch 6.5.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.5.1.0/elasticsearch-sql-6.5.1.0.zip

Elasticsearch 6.5.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.5.2.0/elasticsearch-sql-6.5.2.0.zip

Elasticsearch 6.5.3

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.5.3.0/elasticsearch-sql-6.5.3.0.zip

Elasticsearch 6.5.4

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.5.4.0/elasticsearch-sql-6.5.4.0.zip

Elasticsearch 6.6.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.6.0.0/elasticsearch-sql-6.6.0.0.zip

Elasticsearch 6.6.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.6.1.0/elasticsearch-sql-6.6.1.0.zip

Elasticsearch 6.6.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.6.2.0/elasticsearch-sql-6.6.2.0.zip

Elasticsearch 6.7.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.7.0.0/elasticsearch-sql-6.7.0.0.zip

Elasticsearch 6.7.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.7.1.0/elasticsearch-sql-6.7.1.0.zip

Elasticsearch 6.7.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.7.2.0/elasticsearch-sql-6.7.2.0.zip

Elasticsearch 6.8.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.8.0.0/elasticsearch-sql-6.8.0.0.zip

Elasticsearch 6.8.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.8.1.0/elasticsearch-sql-6.8.1.0.zip

Elasticsearch 6.8.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.8.2.0/elasticsearch-sql-6.8.2.0.zip

Elasticsearch 6.8.3

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.8.3.0/elasticsearch-sql-6.8.3.0.zip

Elasticsearch 6.8.4

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.8.4.0/elasticsearch-sql-6.8.4.0.zip

Elasticsearch 7.0.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.0.0.0/elasticsearch-sql-7.0.0.0.zip

Elasticsearch 7.0.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.0.1.0/elasticsearch-sql-7.0.1.0.zip

Elasticsearch 7.1.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.1.0.0/elasticsearch-sql-7.1.0.0.zip

Elasticsearch 7.1.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.1.1.0/elasticsearch-sql-7.1.1.0.zip

Elasticsearch 7.2.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.2.0.0/elasticsearch-sql-7.2.0.0.zip

Elasticsearch 7.2.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.2.1.0/elasticsearch-sql-7.2.1.0.zip

Elasticsearch 7.3.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.3.0.0/elasticsearch-sql-7.3.0.0.zip

Elasticsearch 7.3.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.3.1.0/elasticsearch-sql-7.3.1.0.zip

Elasticsearch 7.3.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.3.2.0/elasticsearch-sql-7.3.2.0.zip

Elasticsearch 7.4.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.4.0.0/elasticsearch-sql-7.4.0.0.zip

Elasticsearch 7.4.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.4.1.0/elasticsearch-sql-7.4.1.0.zip

Elasticsearch 7.4.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.4.2.0/elasticsearch-sql-7.4.2.0.zip

After doing this, you need to restart the Elasticsearch server. Otherwise you may get errors like Invalid index name [sql], must not start with '']; ","status":400}.

Basic Usage

On elasticsearch 1.x / 2.x, visit the elasticsearch-sql web front-end:

http://localhost:9200/_plugin/sql/

On elasticsearch 5.x/6.x, use elasticsearch sql site chrome extension (make sure to enable cors on elasticsearch.yml). Alternatively, download and extract site, then start the web front-end like this:

cd site-server
npm install express --save
node node-server.js 
  • Simple query
curl -X GET "localhost:9200/_sql" -H 'Content-Type: application/json' -d'select * from indexName limit 10'
  • Explain SQL to elasticsearch query DSL
curl -X GET "localhost:9200/_sql/_explain" -H 'Content-Type: application/json' -d'select * from indexName limit 10'

SQL Usage

  • Query

     SELECT * FROM bank WHERE age >30 AND gender = 'm'
    
  • Aggregation

     select COUNT(*),SUM(age),MIN(age) as m, MAX(age),AVG(age)
    FROM bank GROUP BY gender ORDER BY SUM(age), m DESC
    
  • Delete

     DELETE FROM bank WHERE age >30 AND gender = 'm'
    

Beyond SQL

  • Search

     SELECT address FROM bank WHERE address = matchQuery('880 Holmes Lane') ORDER BY _score DESC LIMIT 3
    
  • Aggregations

    • range age group 20-25,25-30,30-35,35-40

       SELECT COUNT(age) FROM bank GROUP BY range(age, 20,25,30,35,40)
      
    • range date group by day

       SELECT online FROM online GROUP BY date_histogram(field='insert_time','interval'='1d')
      
    • range date group by your config

       SELECT online FROM online GROUP BY date_range(field='insert_time','format'='yyyy-MM-dd' ,'2014-08-18','2014-08-17','now-8d','now-7d','now-6d','now')
      
  • ES Geographic

     SELECT * FROM locations WHERE GEO_BOUNDING_BOX(fieldname,100.0,1.0,101,0.0)
    
  • Select type

     SELECT * FROM indexName/type
    

SQL Features

  • SQL Select
  • SQL Delete
  • SQL Where
    • can use "case when" in where clause
  • SQL Order By
    • can use "case when" in order by clause
  • SQL Group By
  • SQL AND & OR
  • SQL Like
  • SQL COUNT distinct
  • SQL In
  • SQL Between
  • SQL Aliases
  • SQL Not Null
  • SQL(ES) Date
  • SQL avg()
  • SQL count()
  • SQL last()
  • SQL max()
  • SQL min()
  • SQL sum()
  • SQL Nulls
  • SQL isnull()
  • SQL now()
  • SQL floor
  • SQL split
  • SQL trim
  • SQL log
  • SQL log10
  • SQL substring
  • SQL round
    • eg: round(10.135, 2) --> 10.14
  • SQL sqrt
  • SQL concat_ws
  • SQL union and minus
  • SQL case when
    • can use "in"、"not in" judge in case when clause
    • can execute simple calculation in case when clause, eg : case when 1 = 1 then field_1 + field_2 else 0 end
  • SQL if
    • select if(sex='1','男','女') from t_user;
  • SQL limit
    • can set aggregation bucket size and shard size by setting limit, shardSize = 20 * bucketSize
    • eg: select city,count(*) as user_count from t_user group by city limit 100;
    • on the above example, the bucket size is 100, shard size is 20*100 = 2000

JDBC Support (Experimental feature)

Check details : JDBC Support

Beyond sql features

  • ES TopHits
  • ES MISSING
  • ES STATS
  • ES GEO_INTERSECTS
  • ES GEO_BOUNDING_BOX
  • ES GEO_DISTANCE
  • ES GEOHASH_GRID aggregation

About

Use SQL to query Elasticsearch

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' GitHub - dai-chen/elasticsearch-sql: Use SQL to query Elasticsearch · GitHub
Skip to content

Repository files navigation

DEPRECATED

Please note, this project is no longer in active development, and is deprecated, please use official version x-pack-sql.


Elasticsearch-SQL

build status

1.7.61.7.6 Build Status2.0.02.0.0 Build Status2.1.02.1.0 Build Status2.1.12.1.1 Build Status2.1.22.1.2 Build Status2.2.02.2.0 Build Status
2.2.12.2.1 Build Status2.3.02.3.0 Build Status2.3.12.3.1 Build Status2.3.22.3.2 Build Status2.3.32.3.3 Build Status2.3.42.3.4 Build Status
2.3.52.3.5 Build Status2.4.02.4.0 Build Status2.4.12.4.1 Build Status2.4.22.4.2 Build Status2.4.32.4.3 Build Status2.4.42.4.4 Build Status
2.4.52.4.5 Build Status2.4.62.4.6 Build Status5.0.15.0.1 Build Status5.1.15.1.1 Build Status5.1.25.1.2 Build Status5.2.05.2.0 Build Status
5.2.15.2.1 Build Status5.2.25.2.2 Build Status5.3.05.3.0 Build Status5.3.15.3.1 Build Status5.3.25.3.2 Build Status5.3.35.3.3 Build Status
5.4.05.4.0 Build Status5.4.15.4.1 Build Status5.4.25.4.2 Build Status5.4.35.4.3 Build Status5.5.05.5.0 Build Status5.5.15.5.1 Build Status
5.5.25.5.2 Build Status5.5.35.5.3 Build Status5.6.05.6.0 Build Status5.6.15.6.1 Build Status5.6.25.6.2 Build Status5.6.35.6.3 Build Status
5.6.45.6.4 Build Status5.6.55.6.5 Build Status5.6.65.6.6 Build Status5.6.75.6.7 Build Status5.6.85.6.8 Build Status5.6.95.6.9 Build Status
5.6.105.6.10 Build Status5.6.115.6.11 Build Status5.6.125.6.12 Build Status5.6.135.6.13 Build Status5.6.145.6.14 Build Status5.6.155.6.15 Build Status
5.6.165.6.16 Build Status6.0.06.0.0 Build Status6.0.16.0.1 Build Status6.1.06.1.0 Build Status6.1.16.1.1 Build Status6.1.26.1.2 Build Status
6.1.36.1.3 Build Status6.1.46.1.4 Build Status6.2.06.2.0 Build Status6.2.16.2.1 Build Status6.2.26.2.2 Build Status6.2.36.2.3 Build Status
6.2.46.2.4 Build Status6.3.06.3.0 Build Status6.3.16.3.1 Build Status6.3.26.3.2 Build Status6.4.06.4.0 Build Status6.4.16.4.1 Build Status
6.4.26.4.2 Build Status6.4.36.4.3 Build Status6.5.06.5.0 Build Status6.5.16.5.1 Build Status6.5.26.5.2 Build Status6.5.36.5.3 Build Status
6.5.46.5.4 Build Status6.6.06.6.0 Build Status6.6.16.6.1 Build Status6.6.26.6.2 Build Status6.7.06.7.0 Build Status6.7.16.7.1 Build Status
6.7.26.7.2 Build Status6.8.06.8.0 Build Status6.8.16.8.1 Build Status6.8.26.8.2 Build Status6.8.36.8.3 Build Status6.8.46.8.4 Build Status
7.0.07.0.0 Build Status7.0.17.0.1 Build Status7.1.07.1.0 Build Status7.1.17.1.1 Build Status7.2.07.2.0 Build Status7.2.17.2.1 Build Status
7.3.07.3.0 Build Status7.3.17.3.1 Build Status7.3.27.3.2 Build Status7.4.07.4.0 Build Status7.4.17.4.1 Build Status7.4.27.4.2 Build Status

Query elasticsearch using familiar SQL syntax. You can also use ES functions in SQL.

Check out our wiki!

explain example

you can visite : http://essql.nlpcn.org/ , it is a sample example for explain

Web frontend overview

Web frontend overview

SETUP

Install as plugin: Versions

elasticsearch versionlatest versionremarksbranch
1.x1.7.6tested against elastic 1.7.6elastic1.x
2.0.02.0.4delete commands not supportedelastic2.0
2.1.02.1.0.2delete commands not supportedelastic2.1
2.1.12.1.1.1delete commands not supportedelastic2.1.1
2.1.22.1.2.0delete commands not supportedelastic2.1.2
2.2.02.2.0.1delete commands not supportedelastic2.2.0
2.2.12.2.1.0delete commands not supportedelastic2.2.1
2.3.02.3.0.0delete commands not supportedelastic2.3.0
2.3.12.3.1.1delete commands not supportedelastic2.3.1
2.3.22.3.2.0delete commands not supportedelastic2.3.2
2.3.32.3.3.0delete commands not supportedelastic2.3.3
2.3.42.3.4.0delete commands not supportedelastic2.3.4
2.3.52.3.5.0delete commands not supportedelastic2.3.5
2.4.02.4.0.1delete commands not supportedelastic2.4.0
2.4.12.4.1.0delete commands not supportedelastic2.4.1
2.4.22.4.2.1delete commands not supportedelastic2.4.2
2.4.32.4.3.0delete commands not supportedelastic2.4.3
2.4.42.4.4.0delete commands not supportedelastic2.4.4
2.4.52.4.5.0delete commands not supportedelastic2.4.5
2.4.62.4.6.0delete commands not supportedelastic2.4.6
5.0.15.0.1.0delete commands not supportedelastic5.0.1
5.1.15.1.1.0delete commands not supportedelastic5.1.1
5.1.25.1.2.0delete commands not supportedelastic5.1.2
5.2.05.2.0.0delete commands not supportedelastic5.2.0
5.2.15.2.1.0delete commands not supportedelastic5.2.1
5.2.25.2.2.0delete commands not supportedelastic5.2.2
5.3.05.3.0.0delete commands not supportedelastic5.3.0
5.3.15.3.1.0delete commands not supportedelastic5.3.1
5.3.25.3.2.0delete commands not supportedelastic5.3.2
5.3.35.3.3.0delete commands not supportedelastic5.3.3
5.4.05.4.0.0delete commands not supportedelastic5.4.0
5.4.15.4.1.0delete commands not supportedelastic5.4.1
5.4.25.4.2.0delete commands not supportedelastic5.4.2
5.4.35.4.3.0delete commands not supportedelastic5.4.3
5.5.05.5.0.1delete commands not supportedelastic5.5.0
5.5.15.5.1.0delete commands not supportedelastic5.5.1
5.5.25.5.2.0delete commands not supportedelastic5.5.2
5.5.35.5.3.0delete commands not supportedelastic5.5.3
5.6.05.6.0.0delete commands not supportedelastic5.6.0
5.6.15.6.1.0delete commands not supportedelastic5.6.1
5.6.25.6.2.0delete commands not supportedelastic5.6.2
5.6.35.6.3.0delete commands not supportedelastic5.6.3
5.6.45.6.4.0delete commands not supportedelastic5.6.4
5.6.55.6.5.0delete commands not supportedelastic5.6.5
5.6.65.6.6.0elastic5.6.6
5.6.75.6.7.0elastic5.6.7
5.6.85.6.8.0elastic5.6.8
5.6.95.6.9.0elastic5.6.9
5.6.105.6.10.0elastic5.6.10
5.6.115.6.11.0elastic5.6.11
5.6.125.6.12.0elastic5.6.12
5.6.135.6.13.0elastic5.6.13
5.6.145.6.14.0elastic5.6.14
5.6.155.6.15.0elastic5.6.15
5.6.165.6.16.0elastic5.6.16
6.0.06.0.0.0elastic6.0.0
6.0.16.0.1.0elastic6.0.1
6.1.06.1.0.0elastic6.1.0
6.1.16.1.1.0elastic6.1.1
6.1.26.1.2.0elastic6.1.2
6.1.36.1.3.0elastic6.1.3
6.1.46.1.4.0elastic6.1.4
6.2.06.2.0.0elastic6.2.0
6.2.16.2.1.0elastic6.2.1
6.2.26.2.2.0elastic6.2.2
6.2.36.2.3.0elastic6.2.3
6.2.46.2.4.0elastic6.2.4
6.3.06.3.0.0elastic6.3.0
6.3.16.3.1.0elastic6.3.1
6.3.26.3.2.0elastic6.3.2
6.4.06.4.0.0elastic6.4.0
6.4.16.4.1.0elastic6.4.1
6.4.26.4.2.0elastic6.4.2
6.4.36.4.3.0elastic6.4.3
6.5.06.5.0.0elastic6.5.0
6.5.16.5.1.0elastic6.5.1
6.5.26.5.2.0elastic6.5.2
6.5.36.5.3.0elastic6.5.3
6.5.46.5.4.0elastic6.5.4
6.6.06.6.0.0elastic6.6.0
6.6.16.6.1.0elastic6.6.1
6.6.26.6.2.0elastic6.6.2
6.7.06.7.0.0elastic6.7.0
6.7.16.7.1.0elastic6.7.1
6.7.26.7.2.0elastic6.7.2
6.8.06.8.0.0elastic6.8.0
6.8.16.8.1.0elastic6.8.1
6.8.26.8.2.0elastic6.8.2
6.8.36.8.3.0elastic6.8.3
6.8.46.8.4.0elastic6.8.4
7.0.07.0.0.0elastic7.0.0
7.0.17.0.1.0elastic7.0.1
7.1.07.1.0.0elastic7.1.0
7.1.17.1.1.0elastic7.1.1
7.2.07.2.0.0elastic7.2.0
7.2.17.2.1.0elastic7.2.1
7.3.07.3.0.0elastic7.3.0
7.3.17.3.1.0elastic7.3.1
7.3.27.3.2.0elastic7.3.2
7.4.07.4.0.0elastic7.4.0
7.4.17.4.1.0elastic7.4.1
7.4.27.4.2.0elastic7.4.2

Elasticsearch 1.x

./bin/plugin -u https://github.com/NLPchina/elasticsearch-sql/releases/download/1.7.6/elasticsearch-sql-1.7.6.zip --install sql

Elasticsearch 2.0.0

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.0.4/elasticsearch-sql-2.0.4.zip 

Elasticsearch 2.1.0

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.1.0.2/elasticsearch-sql-2.1.0.2.zip 

Elasticsearch 2.1.1

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.1.1.1/elasticsearch-sql-2.1.1.1.zip 

Elasticsearch 2.1.2

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.1.2.0/elasticsearch-sql-2.1.2.0.zip 

Elasticsearch 2.2.0

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.2.0.1/elasticsearch-sql-2.2.0.1.zip 

Elasticsearch 2.2.1

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.2.1.0/elasticsearch-sql-2.2.1.0.zip 

Elasticsearch 2.3.0

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.3.0.0/elasticsearch-sql-2.3.0.0.zip 

Elasticsearch 2.3.1

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.3.1.1/elasticsearch-sql-2.3.1.1.zip 

Elasticsearch 2.3.2

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.3.2.0/elasticsearch-sql-2.3.2.0.zip 

Elasticsearch 2.3.3

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.3.3.0/elasticsearch-sql-2.3.3.0.zip 

Elasticsearch 2.3.4

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.3.4.0/elasticsearch-sql-2.3.4.0.zip 

Elasticsearch 2.3.5

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.3.5.0/elasticsearch-sql-2.3.5.0.zip 

Elasticsearch 2.4.0

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.4.0.1/elasticsearch-sql-2.4.0.1.zip

Elasticsearch 2.4.1

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.4.1.0/elasticsearch-sql-2.4.1.0.zip

Elasticsearch 2.4.2

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.4.2.1/elasticsearch-sql-2.4.2.1.zip

Elasticsearch 2.4.3

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.4.3.0/elasticsearch-sql-2.4.3.0.zip

Elasticsearch 2.4.4

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.4.4.0/elasticsearch-sql-2.4.4.0.zip

Elasticsearch 2.4.5

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.4.5.0/elasticsearch-sql-2.4.5.0.zip

Elasticsearch 2.4.6

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.4.6.0/elasticsearch-sql-2.4.6.0.zip

Elasticsearch 5.0.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.0.1/elasticsearch-sql-5.0.1.0.zip

Elasticsearch 5.1.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.1.1.0/elasticsearch-sql-5.1.1.0.zip

Elasticsearch 5.1.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.1.2.0/elasticsearch-sql-5.1.2.0.zip

Elasticsearch 5.2.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.2.0.0/elasticsearch-sql-5.2.0.0.zip

Elasticsearch 5.2.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.2.1.0/elasticsearch-sql-5.2.1.0.zip

Elasticsearch 5.2.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.2.2.0/elasticsearch-sql-5.2.2.0.zip

Elasticsearch 5.3.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.3.0.0/elasticsearch-sql-5.3.0.0.zip

Elasticsearch 5.3.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.3.1.0/elasticsearch-sql-5.3.1.0.zip

Elasticsearch 5.3.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.3.2.0/elasticsearch-sql-5.3.2.0.zip

Elasticsearch 5.3.3

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.3.3.0/elasticsearch-sql-5.3.3.0.zip

Elasticsearch 5.4.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.4.0.0/elasticsearch-sql-5.4.0.0.zip

Elasticsearch 5.4.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.4.1.0/elasticsearch-sql-5.4.1.0.zip

Elasticsearch 5.4.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.4.2.0/elasticsearch-sql-5.4.2.0.zip

Elasticsearch 5.4.3

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.4.3.0/elasticsearch-sql-5.4.3.0.zip

Elasticsearch 5.5.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.5.0.0/elasticsearch-sql-5.5.0.1.zip

Elasticsearch 5.5.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.5.1.0/elasticsearch-sql-5.5.1.0.zip

Elasticsearch 5.5.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.5.2.0/elasticsearch-sql-5.5.2.0.zip

Elasticsearch 5.5.3

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.5.3.0/elasticsearch-sql-5.5.3.0.zip

Elasticsearch 5.6.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.0.0/elasticsearch-sql-5.6.0.0.zip

Elasticsearch 5.6.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.1.0/elasticsearch-sql-5.6.1.0.zip

Elasticsearch 5.6.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.2.0/elasticsearch-sql-5.6.2.0.zip

Elasticsearch 5.6.3

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.3.0/elasticsearch-sql-5.6.3.0.zip

Elasticsearch 5.6.4

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.4.0/elasticsearch-sql-5.6.4.0.zip

Elasticsearch 5.6.5

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.5.0/elasticsearch-sql-5.6.5.0.zip

Elasticsearch 5.6.6

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.6.0/elasticsearch-sql-5.6.6.0.zip

Elasticsearch 5.6.7

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.7.0/elasticsearch-sql-5.6.7.0.zip

Elasticsearch 5.6.8

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.8.0/elasticsearch-sql-5.6.8.0.zip

Elasticsearch 5.6.9

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.9.0/elasticsearch-sql-5.6.9.0.zip

Elasticsearch 5.6.10

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.10.0/elasticsearch-sql-5.6.10.0.zip

Elasticsearch 5.6.11

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.11.0/elasticsearch-sql-5.6.11.0.zip

Elasticsearch 5.6.12

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.12.0/elasticsearch-sql-5.6.12.0.zip

Elasticsearch 5.6.13

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.13.0/elasticsearch-sql-5.6.13.0.zip

Elasticsearch 5.6.14

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.14.0/elasticsearch-sql-5.6.14.0.zip

Elasticsearch 5.6.15

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.15.0/elasticsearch-sql-5.6.15.0.zip

Elasticsearch 5.6.16

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.16.0/elasticsearch-sql-5.6.16.0.zip

Elasticsearch 6.0.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.0.0.0/elasticsearch-sql-6.0.0.0.zip

Elasticsearch 6.0.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.0.1.0/elasticsearch-sql-6.0.1.0.zip

Elasticsearch 6.1.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.1.0.0/elasticsearch-sql-6.1.0.0.zip

Elasticsearch 6.1.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.1.1.0/elasticsearch-sql-6.1.1.0.zip

Elasticsearch 6.1.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.1.2.0/elasticsearch-sql-6.1.2.0.zip

Elasticsearch 6.1.3

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.1.3.0/elasticsearch-sql-6.1.3.0.zip

Elasticsearch 6.1.4

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.1.4.0/elasticsearch-sql-6.1.4.0.zip

Elasticsearch 6.2.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.2.0.0/elasticsearch-sql-6.2.0.0.zip

Elasticsearch 6.2.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.2.1.0/elasticsearch-sql-6.2.1.0.zip

Elasticsearch 6.2.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.2.2.0/elasticsearch-sql-6.2.2.0.zip

Elasticsearch 6.2.3

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.2.3.0/elasticsearch-sql-6.2.3.0.zip

Elasticsearch 6.2.4

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.2.4.0/elasticsearch-sql-6.2.4.0.zip

Elasticsearch 6.3.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.3.0.0/elasticsearch-sql-6.3.0.0.zip

Elasticsearch 6.3.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.3.1.0/elasticsearch-sql-6.3.1.1.zip

Elasticsearch 6.3.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.3.2.0/elasticsearch-sql-6.3.2.0.zip

Elasticsearch 6.4.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.4.0.0/elasticsearch-sql-6.4.0.0.zip

Elasticsearch 6.4.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.4.1.0/elasticsearch-sql-6.4.1.0.zip

Elasticsearch 6.4.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.4.2.0/elasticsearch-sql-6.4.2.0.zip

Elasticsearch 6.4.3

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.4.3.0/elasticsearch-sql-6.4.3.0.zip

Elasticsearch 6.5.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.5.0.0/elasticsearch-sql-6.5.0.0.zip

Elasticsearch 6.5.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.5.1.0/elasticsearch-sql-6.5.1.0.zip

Elasticsearch 6.5.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.5.2.0/elasticsearch-sql-6.5.2.0.zip

Elasticsearch 6.5.3

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.5.3.0/elasticsearch-sql-6.5.3.0.zip

Elasticsearch 6.5.4

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.5.4.0/elasticsearch-sql-6.5.4.0.zip

Elasticsearch 6.6.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.6.0.0/elasticsearch-sql-6.6.0.0.zip

Elasticsearch 6.6.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.6.1.0/elasticsearch-sql-6.6.1.0.zip

Elasticsearch 6.6.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.6.2.0/elasticsearch-sql-6.6.2.0.zip

Elasticsearch 6.7.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.7.0.0/elasticsearch-sql-6.7.0.0.zip

Elasticsearch 6.7.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.7.1.0/elasticsearch-sql-6.7.1.0.zip

Elasticsearch 6.7.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.7.2.0/elasticsearch-sql-6.7.2.0.zip

Elasticsearch 6.8.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.8.0.0/elasticsearch-sql-6.8.0.0.zip

Elasticsearch 6.8.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.8.1.0/elasticsearch-sql-6.8.1.0.zip

Elasticsearch 6.8.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.8.2.0/elasticsearch-sql-6.8.2.0.zip

Elasticsearch 6.8.3

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.8.3.0/elasticsearch-sql-6.8.3.0.zip

Elasticsearch 6.8.4

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.8.4.0/elasticsearch-sql-6.8.4.0.zip

Elasticsearch 7.0.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.0.0.0/elasticsearch-sql-7.0.0.0.zip

Elasticsearch 7.0.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.0.1.0/elasticsearch-sql-7.0.1.0.zip

Elasticsearch 7.1.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.1.0.0/elasticsearch-sql-7.1.0.0.zip

Elasticsearch 7.1.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.1.1.0/elasticsearch-sql-7.1.1.0.zip

Elasticsearch 7.2.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.2.0.0/elasticsearch-sql-7.2.0.0.zip

Elasticsearch 7.2.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.2.1.0/elasticsearch-sql-7.2.1.0.zip

Elasticsearch 7.3.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.3.0.0/elasticsearch-sql-7.3.0.0.zip

Elasticsearch 7.3.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.3.1.0/elasticsearch-sql-7.3.1.0.zip

Elasticsearch 7.3.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.3.2.0/elasticsearch-sql-7.3.2.0.zip

Elasticsearch 7.4.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.4.0.0/elasticsearch-sql-7.4.0.0.zip

Elasticsearch 7.4.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.4.1.0/elasticsearch-sql-7.4.1.0.zip

Elasticsearch 7.4.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.4.2.0/elasticsearch-sql-7.4.2.0.zip

After doing this, you need to restart the Elasticsearch server. Otherwise you may get errors like Invalid index name [sql], must not start with '']; ","status":400}.

Basic Usage

On elasticsearch 1.x / 2.x, visit the elasticsearch-sql web front-end:

http://localhost:9200/_plugin/sql/

On elasticsearch 5.x/6.x, use elasticsearch sql site chrome extension (make sure to enable cors on elasticsearch.yml). Alternatively, download and extract site, then start the web front-end like this:

cd site-server
npm install express --save
node node-server.js 
  • Simple query
curl -X GET "localhost:9200/_sql" -H 'Content-Type: application/json' -d'select * from indexName limit 10'
  • Explain SQL to elasticsearch query DSL
curl -X GET "localhost:9200/_sql/_explain" -H 'Content-Type: application/json' -d'select * from indexName limit 10'

SQL Usage

  • Query

     SELECT * FROM bank WHERE age >30 AND gender = 'm'
    
  • Aggregation

     select COUNT(*),SUM(age),MIN(age) as m, MAX(age),AVG(age)
    FROM bank GROUP BY gender ORDER BY SUM(age), m DESC
    
  • Delete

     DELETE FROM bank WHERE age >30 AND gender = 'm'
    

Beyond SQL

  • Search

     SELECT address FROM bank WHERE address = matchQuery('880 Holmes Lane') ORDER BY _score DESC LIMIT 3
    
  • Aggregations

    • range age group 20-25,25-30,30-35,35-40

       SELECT COUNT(age) FROM bank GROUP BY range(age, 20,25,30,35,40)
      
    • range date group by day

       SELECT online FROM online GROUP BY date_histogram(field='insert_time','interval'='1d')
      
    • range date group by your config

       SELECT online FROM online GROUP BY date_range(field='insert_time','format'='yyyy-MM-dd' ,'2014-08-18','2014-08-17','now-8d','now-7d','now-6d','now')
      
  • ES Geographic

     SELECT * FROM locations WHERE GEO_BOUNDING_BOX(fieldname,100.0,1.0,101,0.0)
    
  • Select type

     SELECT * FROM indexName/type
    

SQL Features

  • SQL Select
  • SQL Delete
  • SQL Where
    • can use "case when" in where clause
  • SQL Order By
    • can use "case when" in order by clause
  • SQL Group By
  • SQL AND & OR
  • SQL Like
  • SQL COUNT distinct
  • SQL In
  • SQL Between
  • SQL Aliases
  • SQL Not Null
  • SQL(ES) Date
  • SQL avg()
  • SQL count()
  • SQL last()
  • SQL max()
  • SQL min()
  • SQL sum()
  • SQL Nulls
  • SQL isnull()
  • SQL now()
  • SQL floor
  • SQL split
  • SQL trim
  • SQL log
  • SQL log10
  • SQL substring
  • SQL round
    • eg: round(10.135, 2) --> 10.14
  • SQL sqrt
  • SQL concat_ws
  • SQL union and minus
  • SQL case when
    • can use "in"、"not in" judge in case when clause
    • can execute simple calculation in case when clause, eg : case when 1 = 1 then field_1 + field_2 else 0 end
  • SQL if
    • select if(sex='1','男','女') from t_user;
  • SQL limit
    • can set aggregation bucket size and shard size by setting limit, shardSize = 20 * bucketSize
    • eg: select city,count(*) as user_count from t_user group by city limit 100;
    • on the above example, the bucket size is 100, shard size is 20*100 = 2000

JDBC Support (Experimental feature)

Check details : JDBC Support

Beyond sql features

  • ES TopHits
  • ES MISSING
  • ES STATS
  • ES GEO_INTERSECTS
  • ES GEO_BOUNDING_BOX
  • ES GEO_DISTANCE
  • ES GEOHASH_GRID aggregation

About

Use SQL to query Elasticsearch

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' GitHub - dai-chen/elasticsearch-sql: Use SQL to query Elasticsearch · GitHub
Skip to content

Repository files navigation

DEPRECATED

Please note, this project is no longer in active development, and is deprecated, please use official version x-pack-sql.


Elasticsearch-SQL

build status

1.7.61.7.6 Build Status2.0.02.0.0 Build Status2.1.02.1.0 Build Status2.1.12.1.1 Build Status2.1.22.1.2 Build Status2.2.02.2.0 Build Status
2.2.12.2.1 Build Status2.3.02.3.0 Build Status2.3.12.3.1 Build Status2.3.22.3.2 Build Status2.3.32.3.3 Build Status2.3.42.3.4 Build Status
2.3.52.3.5 Build Status2.4.02.4.0 Build Status2.4.12.4.1 Build Status2.4.22.4.2 Build Status2.4.32.4.3 Build Status2.4.42.4.4 Build Status
2.4.52.4.5 Build Status2.4.62.4.6 Build Status5.0.15.0.1 Build Status5.1.15.1.1 Build Status5.1.25.1.2 Build Status5.2.05.2.0 Build Status
5.2.15.2.1 Build Status5.2.25.2.2 Build Status5.3.05.3.0 Build Status5.3.15.3.1 Build Status5.3.25.3.2 Build Status5.3.35.3.3 Build Status
5.4.05.4.0 Build Status5.4.15.4.1 Build Status5.4.25.4.2 Build Status5.4.35.4.3 Build Status5.5.05.5.0 Build Status5.5.15.5.1 Build Status
5.5.25.5.2 Build Status5.5.35.5.3 Build Status5.6.05.6.0 Build Status5.6.15.6.1 Build Status5.6.25.6.2 Build Status5.6.35.6.3 Build Status
5.6.45.6.4 Build Status5.6.55.6.5 Build Status5.6.65.6.6 Build Status5.6.75.6.7 Build Status5.6.85.6.8 Build Status5.6.95.6.9 Build Status
5.6.105.6.10 Build Status5.6.115.6.11 Build Status5.6.125.6.12 Build Status5.6.135.6.13 Build Status5.6.145.6.14 Build Status5.6.155.6.15 Build Status
5.6.165.6.16 Build Status6.0.06.0.0 Build Status6.0.16.0.1 Build Status6.1.06.1.0 Build Status6.1.16.1.1 Build Status6.1.26.1.2 Build Status
6.1.36.1.3 Build Status6.1.46.1.4 Build Status6.2.06.2.0 Build Status6.2.16.2.1 Build Status6.2.26.2.2 Build Status6.2.36.2.3 Build Status
6.2.46.2.4 Build Status6.3.06.3.0 Build Status6.3.16.3.1 Build Status6.3.26.3.2 Build Status6.4.06.4.0 Build Status6.4.16.4.1 Build Status
6.4.26.4.2 Build Status6.4.36.4.3 Build Status6.5.06.5.0 Build Status6.5.16.5.1 Build Status6.5.26.5.2 Build Status6.5.36.5.3 Build Status
6.5.46.5.4 Build Status6.6.06.6.0 Build Status6.6.16.6.1 Build Status6.6.26.6.2 Build Status6.7.06.7.0 Build Status6.7.16.7.1 Build Status
6.7.26.7.2 Build Status6.8.06.8.0 Build Status6.8.16.8.1 Build Status6.8.26.8.2 Build Status6.8.36.8.3 Build Status6.8.46.8.4 Build Status
7.0.07.0.0 Build Status7.0.17.0.1 Build Status7.1.07.1.0 Build Status7.1.17.1.1 Build Status7.2.07.2.0 Build Status7.2.17.2.1 Build Status
7.3.07.3.0 Build Status7.3.17.3.1 Build Status7.3.27.3.2 Build Status7.4.07.4.0 Build Status7.4.17.4.1 Build Status7.4.27.4.2 Build Status

Query elasticsearch using familiar SQL syntax. You can also use ES functions in SQL.

Check out our wiki!

explain example

you can visite : http://essql.nlpcn.org/ , it is a sample example for explain

Web frontend overview

Web frontend overview

SETUP

Install as plugin: Versions

elasticsearch versionlatest versionremarksbranch
1.x1.7.6tested against elastic 1.7.6elastic1.x
2.0.02.0.4delete commands not supportedelastic2.0
2.1.02.1.0.2delete commands not supportedelastic2.1
2.1.12.1.1.1delete commands not supportedelastic2.1.1
2.1.22.1.2.0delete commands not supportedelastic2.1.2
2.2.02.2.0.1delete commands not supportedelastic2.2.0
2.2.12.2.1.0delete commands not supportedelastic2.2.1
2.3.02.3.0.0delete commands not supportedelastic2.3.0
2.3.12.3.1.1delete commands not supportedelastic2.3.1
2.3.22.3.2.0delete commands not supportedelastic2.3.2
2.3.32.3.3.0delete commands not supportedelastic2.3.3
2.3.42.3.4.0delete commands not supportedelastic2.3.4
2.3.52.3.5.0delete commands not supportedelastic2.3.5
2.4.02.4.0.1delete commands not supportedelastic2.4.0
2.4.12.4.1.0delete commands not supportedelastic2.4.1
2.4.22.4.2.1delete commands not supportedelastic2.4.2
2.4.32.4.3.0delete commands not supportedelastic2.4.3
2.4.42.4.4.0delete commands not supportedelastic2.4.4
2.4.52.4.5.0delete commands not supportedelastic2.4.5
2.4.62.4.6.0delete commands not supportedelastic2.4.6
5.0.15.0.1.0delete commands not supportedelastic5.0.1
5.1.15.1.1.0delete commands not supportedelastic5.1.1
5.1.25.1.2.0delete commands not supportedelastic5.1.2
5.2.05.2.0.0delete commands not supportedelastic5.2.0
5.2.15.2.1.0delete commands not supportedelastic5.2.1
5.2.25.2.2.0delete commands not supportedelastic5.2.2
5.3.05.3.0.0delete commands not supportedelastic5.3.0
5.3.15.3.1.0delete commands not supportedelastic5.3.1
5.3.25.3.2.0delete commands not supportedelastic5.3.2
5.3.35.3.3.0delete commands not supportedelastic5.3.3
5.4.05.4.0.0delete commands not supportedelastic5.4.0
5.4.15.4.1.0delete commands not supportedelastic5.4.1
5.4.25.4.2.0delete commands not supportedelastic5.4.2
5.4.35.4.3.0delete commands not supportedelastic5.4.3
5.5.05.5.0.1delete commands not supportedelastic5.5.0
5.5.15.5.1.0delete commands not supportedelastic5.5.1
5.5.25.5.2.0delete commands not supportedelastic5.5.2
5.5.35.5.3.0delete commands not supportedelastic5.5.3
5.6.05.6.0.0delete commands not supportedelastic5.6.0
5.6.15.6.1.0delete commands not supportedelastic5.6.1
5.6.25.6.2.0delete commands not supportedelastic5.6.2
5.6.35.6.3.0delete commands not supportedelastic5.6.3
5.6.45.6.4.0delete commands not supportedelastic5.6.4
5.6.55.6.5.0delete commands not supportedelastic5.6.5
5.6.65.6.6.0elastic5.6.6
5.6.75.6.7.0elastic5.6.7
5.6.85.6.8.0elastic5.6.8
5.6.95.6.9.0elastic5.6.9
5.6.105.6.10.0elastic5.6.10
5.6.115.6.11.0elastic5.6.11
5.6.125.6.12.0elastic5.6.12
5.6.135.6.13.0elastic5.6.13
5.6.145.6.14.0elastic5.6.14
5.6.155.6.15.0elastic5.6.15
5.6.165.6.16.0elastic5.6.16
6.0.06.0.0.0elastic6.0.0
6.0.16.0.1.0elastic6.0.1
6.1.06.1.0.0elastic6.1.0
6.1.16.1.1.0elastic6.1.1
6.1.26.1.2.0elastic6.1.2
6.1.36.1.3.0elastic6.1.3
6.1.46.1.4.0elastic6.1.4
6.2.06.2.0.0elastic6.2.0
6.2.16.2.1.0elastic6.2.1
6.2.26.2.2.0elastic6.2.2
6.2.36.2.3.0elastic6.2.3
6.2.46.2.4.0elastic6.2.4
6.3.06.3.0.0elastic6.3.0
6.3.16.3.1.0elastic6.3.1
6.3.26.3.2.0elastic6.3.2
6.4.06.4.0.0elastic6.4.0
6.4.16.4.1.0elastic6.4.1
6.4.26.4.2.0elastic6.4.2
6.4.36.4.3.0elastic6.4.3
6.5.06.5.0.0elastic6.5.0
6.5.16.5.1.0elastic6.5.1
6.5.26.5.2.0elastic6.5.2
6.5.36.5.3.0elastic6.5.3
6.5.46.5.4.0elastic6.5.4
6.6.06.6.0.0elastic6.6.0
6.6.16.6.1.0elastic6.6.1
6.6.26.6.2.0elastic6.6.2
6.7.06.7.0.0elastic6.7.0
6.7.16.7.1.0elastic6.7.1
6.7.26.7.2.0elastic6.7.2
6.8.06.8.0.0elastic6.8.0
6.8.16.8.1.0elastic6.8.1
6.8.26.8.2.0elastic6.8.2
6.8.36.8.3.0elastic6.8.3
6.8.46.8.4.0elastic6.8.4
7.0.07.0.0.0elastic7.0.0
7.0.17.0.1.0elastic7.0.1
7.1.07.1.0.0elastic7.1.0
7.1.17.1.1.0elastic7.1.1
7.2.07.2.0.0elastic7.2.0
7.2.17.2.1.0elastic7.2.1
7.3.07.3.0.0elastic7.3.0
7.3.17.3.1.0elastic7.3.1
7.3.27.3.2.0elastic7.3.2
7.4.07.4.0.0elastic7.4.0
7.4.17.4.1.0elastic7.4.1
7.4.27.4.2.0elastic7.4.2

Elasticsearch 1.x

./bin/plugin -u https://github.com/NLPchina/elasticsearch-sql/releases/download/1.7.6/elasticsearch-sql-1.7.6.zip --install sql

Elasticsearch 2.0.0

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.0.4/elasticsearch-sql-2.0.4.zip 

Elasticsearch 2.1.0

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.1.0.2/elasticsearch-sql-2.1.0.2.zip 

Elasticsearch 2.1.1

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.1.1.1/elasticsearch-sql-2.1.1.1.zip 

Elasticsearch 2.1.2

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.1.2.0/elasticsearch-sql-2.1.2.0.zip 

Elasticsearch 2.2.0

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.2.0.1/elasticsearch-sql-2.2.0.1.zip 

Elasticsearch 2.2.1

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.2.1.0/elasticsearch-sql-2.2.1.0.zip 

Elasticsearch 2.3.0

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.3.0.0/elasticsearch-sql-2.3.0.0.zip 

Elasticsearch 2.3.1

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.3.1.1/elasticsearch-sql-2.3.1.1.zip 

Elasticsearch 2.3.2

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.3.2.0/elasticsearch-sql-2.3.2.0.zip 

Elasticsearch 2.3.3

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.3.3.0/elasticsearch-sql-2.3.3.0.zip 

Elasticsearch 2.3.4

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.3.4.0/elasticsearch-sql-2.3.4.0.zip 

Elasticsearch 2.3.5

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.3.5.0/elasticsearch-sql-2.3.5.0.zip 

Elasticsearch 2.4.0

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.4.0.1/elasticsearch-sql-2.4.0.1.zip

Elasticsearch 2.4.1

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.4.1.0/elasticsearch-sql-2.4.1.0.zip

Elasticsearch 2.4.2

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.4.2.1/elasticsearch-sql-2.4.2.1.zip

Elasticsearch 2.4.3

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.4.3.0/elasticsearch-sql-2.4.3.0.zip

Elasticsearch 2.4.4

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.4.4.0/elasticsearch-sql-2.4.4.0.zip

Elasticsearch 2.4.5

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.4.5.0/elasticsearch-sql-2.4.5.0.zip

Elasticsearch 2.4.6

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.4.6.0/elasticsearch-sql-2.4.6.0.zip

Elasticsearch 5.0.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.0.1/elasticsearch-sql-5.0.1.0.zip

Elasticsearch 5.1.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.1.1.0/elasticsearch-sql-5.1.1.0.zip

Elasticsearch 5.1.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.1.2.0/elasticsearch-sql-5.1.2.0.zip

Elasticsearch 5.2.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.2.0.0/elasticsearch-sql-5.2.0.0.zip

Elasticsearch 5.2.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.2.1.0/elasticsearch-sql-5.2.1.0.zip

Elasticsearch 5.2.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.2.2.0/elasticsearch-sql-5.2.2.0.zip

Elasticsearch 5.3.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.3.0.0/elasticsearch-sql-5.3.0.0.zip

Elasticsearch 5.3.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.3.1.0/elasticsearch-sql-5.3.1.0.zip

Elasticsearch 5.3.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.3.2.0/elasticsearch-sql-5.3.2.0.zip

Elasticsearch 5.3.3

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.3.3.0/elasticsearch-sql-5.3.3.0.zip

Elasticsearch 5.4.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.4.0.0/elasticsearch-sql-5.4.0.0.zip

Elasticsearch 5.4.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.4.1.0/elasticsearch-sql-5.4.1.0.zip

Elasticsearch 5.4.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.4.2.0/elasticsearch-sql-5.4.2.0.zip

Elasticsearch 5.4.3

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.4.3.0/elasticsearch-sql-5.4.3.0.zip

Elasticsearch 5.5.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.5.0.0/elasticsearch-sql-5.5.0.1.zip

Elasticsearch 5.5.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.5.1.0/elasticsearch-sql-5.5.1.0.zip

Elasticsearch 5.5.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.5.2.0/elasticsearch-sql-5.5.2.0.zip

Elasticsearch 5.5.3

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.5.3.0/elasticsearch-sql-5.5.3.0.zip

Elasticsearch 5.6.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.0.0/elasticsearch-sql-5.6.0.0.zip

Elasticsearch 5.6.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.1.0/elasticsearch-sql-5.6.1.0.zip

Elasticsearch 5.6.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.2.0/elasticsearch-sql-5.6.2.0.zip

Elasticsearch 5.6.3

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.3.0/elasticsearch-sql-5.6.3.0.zip

Elasticsearch 5.6.4

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.4.0/elasticsearch-sql-5.6.4.0.zip

Elasticsearch 5.6.5

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.5.0/elasticsearch-sql-5.6.5.0.zip

Elasticsearch 5.6.6

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.6.0/elasticsearch-sql-5.6.6.0.zip

Elasticsearch 5.6.7

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.7.0/elasticsearch-sql-5.6.7.0.zip

Elasticsearch 5.6.8

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.8.0/elasticsearch-sql-5.6.8.0.zip

Elasticsearch 5.6.9

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.9.0/elasticsearch-sql-5.6.9.0.zip

Elasticsearch 5.6.10

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.10.0/elasticsearch-sql-5.6.10.0.zip

Elasticsearch 5.6.11

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.11.0/elasticsearch-sql-5.6.11.0.zip

Elasticsearch 5.6.12

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.12.0/elasticsearch-sql-5.6.12.0.zip

Elasticsearch 5.6.13

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.13.0/elasticsearch-sql-5.6.13.0.zip

Elasticsearch 5.6.14

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.14.0/elasticsearch-sql-5.6.14.0.zip

Elasticsearch 5.6.15

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.15.0/elasticsearch-sql-5.6.15.0.zip

Elasticsearch 5.6.16

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.16.0/elasticsearch-sql-5.6.16.0.zip

Elasticsearch 6.0.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.0.0.0/elasticsearch-sql-6.0.0.0.zip

Elasticsearch 6.0.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.0.1.0/elasticsearch-sql-6.0.1.0.zip

Elasticsearch 6.1.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.1.0.0/elasticsearch-sql-6.1.0.0.zip

Elasticsearch 6.1.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.1.1.0/elasticsearch-sql-6.1.1.0.zip

Elasticsearch 6.1.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.1.2.0/elasticsearch-sql-6.1.2.0.zip

Elasticsearch 6.1.3

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.1.3.0/elasticsearch-sql-6.1.3.0.zip

Elasticsearch 6.1.4

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.1.4.0/elasticsearch-sql-6.1.4.0.zip

Elasticsearch 6.2.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.2.0.0/elasticsearch-sql-6.2.0.0.zip

Elasticsearch 6.2.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.2.1.0/elasticsearch-sql-6.2.1.0.zip

Elasticsearch 6.2.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.2.2.0/elasticsearch-sql-6.2.2.0.zip

Elasticsearch 6.2.3

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.2.3.0/elasticsearch-sql-6.2.3.0.zip

Elasticsearch 6.2.4

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.2.4.0/elasticsearch-sql-6.2.4.0.zip

Elasticsearch 6.3.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.3.0.0/elasticsearch-sql-6.3.0.0.zip

Elasticsearch 6.3.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.3.1.0/elasticsearch-sql-6.3.1.1.zip

Elasticsearch 6.3.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.3.2.0/elasticsearch-sql-6.3.2.0.zip

Elasticsearch 6.4.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.4.0.0/elasticsearch-sql-6.4.0.0.zip

Elasticsearch 6.4.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.4.1.0/elasticsearch-sql-6.4.1.0.zip

Elasticsearch 6.4.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.4.2.0/elasticsearch-sql-6.4.2.0.zip

Elasticsearch 6.4.3

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.4.3.0/elasticsearch-sql-6.4.3.0.zip

Elasticsearch 6.5.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.5.0.0/elasticsearch-sql-6.5.0.0.zip

Elasticsearch 6.5.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.5.1.0/elasticsearch-sql-6.5.1.0.zip

Elasticsearch 6.5.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.5.2.0/elasticsearch-sql-6.5.2.0.zip

Elasticsearch 6.5.3

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.5.3.0/elasticsearch-sql-6.5.3.0.zip

Elasticsearch 6.5.4

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.5.4.0/elasticsearch-sql-6.5.4.0.zip

Elasticsearch 6.6.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.6.0.0/elasticsearch-sql-6.6.0.0.zip

Elasticsearch 6.6.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.6.1.0/elasticsearch-sql-6.6.1.0.zip

Elasticsearch 6.6.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.6.2.0/elasticsearch-sql-6.6.2.0.zip

Elasticsearch 6.7.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.7.0.0/elasticsearch-sql-6.7.0.0.zip

Elasticsearch 6.7.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.7.1.0/elasticsearch-sql-6.7.1.0.zip

Elasticsearch 6.7.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.7.2.0/elasticsearch-sql-6.7.2.0.zip

Elasticsearch 6.8.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.8.0.0/elasticsearch-sql-6.8.0.0.zip

Elasticsearch 6.8.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.8.1.0/elasticsearch-sql-6.8.1.0.zip

Elasticsearch 6.8.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.8.2.0/elasticsearch-sql-6.8.2.0.zip

Elasticsearch 6.8.3

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.8.3.0/elasticsearch-sql-6.8.3.0.zip

Elasticsearch 6.8.4

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.8.4.0/elasticsearch-sql-6.8.4.0.zip

Elasticsearch 7.0.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.0.0.0/elasticsearch-sql-7.0.0.0.zip

Elasticsearch 7.0.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.0.1.0/elasticsearch-sql-7.0.1.0.zip

Elasticsearch 7.1.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.1.0.0/elasticsearch-sql-7.1.0.0.zip

Elasticsearch 7.1.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.1.1.0/elasticsearch-sql-7.1.1.0.zip

Elasticsearch 7.2.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.2.0.0/elasticsearch-sql-7.2.0.0.zip

Elasticsearch 7.2.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.2.1.0/elasticsearch-sql-7.2.1.0.zip

Elasticsearch 7.3.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.3.0.0/elasticsearch-sql-7.3.0.0.zip

Elasticsearch 7.3.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.3.1.0/elasticsearch-sql-7.3.1.0.zip

Elasticsearch 7.3.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.3.2.0/elasticsearch-sql-7.3.2.0.zip

Elasticsearch 7.4.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.4.0.0/elasticsearch-sql-7.4.0.0.zip

Elasticsearch 7.4.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.4.1.0/elasticsearch-sql-7.4.1.0.zip

Elasticsearch 7.4.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.4.2.0/elasticsearch-sql-7.4.2.0.zip

After doing this, you need to restart the Elasticsearch server. Otherwise you may get errors like Invalid index name [sql], must not start with '']; ","status":400}.

Basic Usage

On elasticsearch 1.x / 2.x, visit the elasticsearch-sql web front-end:

http://localhost:9200/_plugin/sql/

On elasticsearch 5.x/6.x, use elasticsearch sql site chrome extension (make sure to enable cors on elasticsearch.yml). Alternatively, download and extract site, then start the web front-end like this:

cd site-server
npm install express --save
node node-server.js 
  • Simple query
curl -X GET "localhost:9200/_sql" -H 'Content-Type: application/json' -d'select * from indexName limit 10'
  • Explain SQL to elasticsearch query DSL
curl -X GET "localhost:9200/_sql/_explain" -H 'Content-Type: application/json' -d'select * from indexName limit 10'

SQL Usage

  • Query

     SELECT * FROM bank WHERE age >30 AND gender = 'm'
    
  • Aggregation

     select COUNT(*),SUM(age),MIN(age) as m, MAX(age),AVG(age)
    FROM bank GROUP BY gender ORDER BY SUM(age), m DESC
    
  • Delete

     DELETE FROM bank WHERE age >30 AND gender = 'm'
    

Beyond SQL

  • Search

     SELECT address FROM bank WHERE address = matchQuery('880 Holmes Lane') ORDER BY _score DESC LIMIT 3
    
  • Aggregations

    • range age group 20-25,25-30,30-35,35-40

       SELECT COUNT(age) FROM bank GROUP BY range(age, 20,25,30,35,40)
      
    • range date group by day

       SELECT online FROM online GROUP BY date_histogram(field='insert_time','interval'='1d')
      
    • range date group by your config

       SELECT online FROM online GROUP BY date_range(field='insert_time','format'='yyyy-MM-dd' ,'2014-08-18','2014-08-17','now-8d','now-7d','now-6d','now')
      
  • ES Geographic

     SELECT * FROM locations WHERE GEO_BOUNDING_BOX(fieldname,100.0,1.0,101,0.0)
    
  • Select type

     SELECT * FROM indexName/type
    

SQL Features

  • SQL Select
  • SQL Delete
  • SQL Where
    • can use "case when" in where clause
  • SQL Order By
    • can use "case when" in order by clause
  • SQL Group By
  • SQL AND & OR
  • SQL Like
  • SQL COUNT distinct
  • SQL In
  • SQL Between
  • SQL Aliases
  • SQL Not Null
  • SQL(ES) Date
  • SQL avg()
  • SQL count()
  • SQL last()
  • SQL max()
  • SQL min()
  • SQL sum()
  • SQL Nulls
  • SQL isnull()
  • SQL now()
  • SQL floor
  • SQL split
  • SQL trim
  • SQL log
  • SQL log10
  • SQL substring
  • SQL round
    • eg: round(10.135, 2) --> 10.14
  • SQL sqrt
  • SQL concat_ws
  • SQL union and minus
  • SQL case when
    • can use "in"、"not in" judge in case when clause
    • can execute simple calculation in case when clause, eg : case when 1 = 1 then field_1 + field_2 else 0 end
  • SQL if
    • select if(sex='1','男','女') from t_user;
  • SQL limit
    • can set aggregation bucket size and shard size by setting limit, shardSize = 20 * bucketSize
    • eg: select city,count(*) as user_count from t_user group by city limit 100;
    • on the above example, the bucket size is 100, shard size is 20*100 = 2000

JDBC Support (Experimental feature)

Check details : JDBC Support

Beyond sql features

  • ES TopHits
  • ES MISSING
  • ES STATS
  • ES GEO_INTERSECTS
  • ES GEO_BOUNDING_BOX
  • ES GEO_DISTANCE
  • ES GEOHASH_GRID aggregation

About

Use SQL to query Elasticsearch

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Universal Dark Mode - works on any site (function() { var enabled = true; function applyDarkMode() { if (!enabled) return; // Create style element if it doesn't exist var style = document.getElementById('universal-dark-mode-style'); if (!style) { style = document.createElement('style'); style.id = 'universal-dark-mode-style'; document.head.appendChild(style); } // Dark mode CSS - inverts colors but preserves images/video style.textContent = ' /* Invert everything except media */ html { filter: invert(1) hue-rotate(180deg) !important; background: #1a1a2e !important; } /* Restore images, videos, iframes, canvas */ img, video, iframe, canvas, svg, picture, [style*="background-image"] { filter: invert(1) hue-rotate(180deg) !important; } /* Preserve specific elements that should not be inverted */ .no-dark-mode, .no-dark-mode *, [data-theme="light"], [data-theme="light"], .ace_editor, .ace_editor *, .CodeMirror, .CodeMirror *, .monaco-editor, .monaco-editor *, .markdown-body pre, .markdown-body pre *, .highlight, .highlight *, pre code, pre code * { filter: none !important; } /* Fix common UI elements */ .modal, .popup, .dropdown-menu, .tooltip, .popover { filter: invert(1) hue-rotate(180deg) !important; background: #2d2d44 !important; border-color: #444 !important; } /* Scrollbars */ ::-webkit-scrollbar { background: #1a1a2e !important; } ::-webkit-scrollbar-thumb { background: #444 !important; } ::-webkit-scrollbar-thumb:hover { background: #555 !important; } /* Selection */ ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; } ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; } '; } function removeDarkMode() { var style = document.getElementById('universal-dark-mode-style'); if (style) style.remove(); } // Toggle with Alt+Shift+D document.addEventListener('keydown', function(e) { if (e.altKey && e.shiftKey && e.key === 'D') { e.preventDefault(); enabled = !enabled; if (enabled) { applyDarkMode(); console.log('[Universal Dark Mode] Enabled'); } else { removeDarkMode(); console.log('[Universal Dark Mode] Disabled'); } } }); // Apply on load applyDarkMode(); // Re-apply on dynamic content var observer = new MutationObserver(function(mutations) { if (enabled && !document.getElementById('universal-dark-mode-style')) { applyDarkMode(); } }); observer.observe(document.head, { childList: true }); console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle'); })(); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })(); GitHub - dai-chen/elasticsearch-sql: Use SQL to query Elasticsearch · GitHub
Skip to content

Repository files navigation

DEPRECATED

Please note, this project is no longer in active development, and is deprecated, please use official version x-pack-sql.


Elasticsearch-SQL

build status

1.7.61.7.6 Build Status2.0.02.0.0 Build Status2.1.02.1.0 Build Status2.1.12.1.1 Build Status2.1.22.1.2 Build Status2.2.02.2.0 Build Status
2.2.12.2.1 Build Status2.3.02.3.0 Build Status2.3.12.3.1 Build Status2.3.22.3.2 Build Status2.3.32.3.3 Build Status2.3.42.3.4 Build Status
2.3.52.3.5 Build Status2.4.02.4.0 Build Status2.4.12.4.1 Build Status2.4.22.4.2 Build Status2.4.32.4.3 Build Status2.4.42.4.4 Build Status
2.4.52.4.5 Build Status2.4.62.4.6 Build Status5.0.15.0.1 Build Status5.1.15.1.1 Build Status5.1.25.1.2 Build Status5.2.05.2.0 Build Status
5.2.15.2.1 Build Status5.2.25.2.2 Build Status5.3.05.3.0 Build Status5.3.15.3.1 Build Status5.3.25.3.2 Build Status5.3.35.3.3 Build Status
5.4.05.4.0 Build Status5.4.15.4.1 Build Status5.4.25.4.2 Build Status5.4.35.4.3 Build Status5.5.05.5.0 Build Status5.5.15.5.1 Build Status
5.5.25.5.2 Build Status5.5.35.5.3 Build Status5.6.05.6.0 Build Status5.6.15.6.1 Build Status5.6.25.6.2 Build Status5.6.35.6.3 Build Status
5.6.45.6.4 Build Status5.6.55.6.5 Build Status5.6.65.6.6 Build Status5.6.75.6.7 Build Status5.6.85.6.8 Build Status5.6.95.6.9 Build Status
5.6.105.6.10 Build Status5.6.115.6.11 Build Status5.6.125.6.12 Build Status5.6.135.6.13 Build Status5.6.145.6.14 Build Status5.6.155.6.15 Build Status
5.6.165.6.16 Build Status6.0.06.0.0 Build Status6.0.16.0.1 Build Status6.1.06.1.0 Build Status6.1.16.1.1 Build Status6.1.26.1.2 Build Status
6.1.36.1.3 Build Status6.1.46.1.4 Build Status6.2.06.2.0 Build Status6.2.16.2.1 Build Status6.2.26.2.2 Build Status6.2.36.2.3 Build Status
6.2.46.2.4 Build Status6.3.06.3.0 Build Status6.3.16.3.1 Build Status6.3.26.3.2 Build Status6.4.06.4.0 Build Status6.4.16.4.1 Build Status
6.4.26.4.2 Build Status6.4.36.4.3 Build Status6.5.06.5.0 Build Status6.5.16.5.1 Build Status6.5.26.5.2 Build Status6.5.36.5.3 Build Status
6.5.46.5.4 Build Status6.6.06.6.0 Build Status6.6.16.6.1 Build Status6.6.26.6.2 Build Status6.7.06.7.0 Build Status6.7.16.7.1 Build Status
6.7.26.7.2 Build Status6.8.06.8.0 Build Status6.8.16.8.1 Build Status6.8.26.8.2 Build Status6.8.36.8.3 Build Status6.8.46.8.4 Build Status
7.0.07.0.0 Build Status7.0.17.0.1 Build Status7.1.07.1.0 Build Status7.1.17.1.1 Build Status7.2.07.2.0 Build Status7.2.17.2.1 Build Status
7.3.07.3.0 Build Status7.3.17.3.1 Build Status7.3.27.3.2 Build Status7.4.07.4.0 Build Status7.4.17.4.1 Build Status7.4.27.4.2 Build Status

Query elasticsearch using familiar SQL syntax. You can also use ES functions in SQL.

Check out our wiki!

explain example

you can visite : http://essql.nlpcn.org/ , it is a sample example for explain

Web frontend overview

Web frontend overview

SETUP

Install as plugin: Versions

elasticsearch versionlatest versionremarksbranch
1.x1.7.6tested against elastic 1.7.6elastic1.x
2.0.02.0.4delete commands not supportedelastic2.0
2.1.02.1.0.2delete commands not supportedelastic2.1
2.1.12.1.1.1delete commands not supportedelastic2.1.1
2.1.22.1.2.0delete commands not supportedelastic2.1.2
2.2.02.2.0.1delete commands not supportedelastic2.2.0
2.2.12.2.1.0delete commands not supportedelastic2.2.1
2.3.02.3.0.0delete commands not supportedelastic2.3.0
2.3.12.3.1.1delete commands not supportedelastic2.3.1
2.3.22.3.2.0delete commands not supportedelastic2.3.2
2.3.32.3.3.0delete commands not supportedelastic2.3.3
2.3.42.3.4.0delete commands not supportedelastic2.3.4
2.3.52.3.5.0delete commands not supportedelastic2.3.5
2.4.02.4.0.1delete commands not supportedelastic2.4.0
2.4.12.4.1.0delete commands not supportedelastic2.4.1
2.4.22.4.2.1delete commands not supportedelastic2.4.2
2.4.32.4.3.0delete commands not supportedelastic2.4.3
2.4.42.4.4.0delete commands not supportedelastic2.4.4
2.4.52.4.5.0delete commands not supportedelastic2.4.5
2.4.62.4.6.0delete commands not supportedelastic2.4.6
5.0.15.0.1.0delete commands not supportedelastic5.0.1
5.1.15.1.1.0delete commands not supportedelastic5.1.1
5.1.25.1.2.0delete commands not supportedelastic5.1.2
5.2.05.2.0.0delete commands not supportedelastic5.2.0
5.2.15.2.1.0delete commands not supportedelastic5.2.1
5.2.25.2.2.0delete commands not supportedelastic5.2.2
5.3.05.3.0.0delete commands not supportedelastic5.3.0
5.3.15.3.1.0delete commands not supportedelastic5.3.1
5.3.25.3.2.0delete commands not supportedelastic5.3.2
5.3.35.3.3.0delete commands not supportedelastic5.3.3
5.4.05.4.0.0delete commands not supportedelastic5.4.0
5.4.15.4.1.0delete commands not supportedelastic5.4.1
5.4.25.4.2.0delete commands not supportedelastic5.4.2
5.4.35.4.3.0delete commands not supportedelastic5.4.3
5.5.05.5.0.1delete commands not supportedelastic5.5.0
5.5.15.5.1.0delete commands not supportedelastic5.5.1
5.5.25.5.2.0delete commands not supportedelastic5.5.2
5.5.35.5.3.0delete commands not supportedelastic5.5.3
5.6.05.6.0.0delete commands not supportedelastic5.6.0
5.6.15.6.1.0delete commands not supportedelastic5.6.1
5.6.25.6.2.0delete commands not supportedelastic5.6.2
5.6.35.6.3.0delete commands not supportedelastic5.6.3
5.6.45.6.4.0delete commands not supportedelastic5.6.4
5.6.55.6.5.0delete commands not supportedelastic5.6.5
5.6.65.6.6.0elastic5.6.6
5.6.75.6.7.0elastic5.6.7
5.6.85.6.8.0elastic5.6.8
5.6.95.6.9.0elastic5.6.9
5.6.105.6.10.0elastic5.6.10
5.6.115.6.11.0elastic5.6.11
5.6.125.6.12.0elastic5.6.12
5.6.135.6.13.0elastic5.6.13
5.6.145.6.14.0elastic5.6.14
5.6.155.6.15.0elastic5.6.15
5.6.165.6.16.0elastic5.6.16
6.0.06.0.0.0elastic6.0.0
6.0.16.0.1.0elastic6.0.1
6.1.06.1.0.0elastic6.1.0
6.1.16.1.1.0elastic6.1.1
6.1.26.1.2.0elastic6.1.2
6.1.36.1.3.0elastic6.1.3
6.1.46.1.4.0elastic6.1.4
6.2.06.2.0.0elastic6.2.0
6.2.16.2.1.0elastic6.2.1
6.2.26.2.2.0elastic6.2.2
6.2.36.2.3.0elastic6.2.3
6.2.46.2.4.0elastic6.2.4
6.3.06.3.0.0elastic6.3.0
6.3.16.3.1.0elastic6.3.1
6.3.26.3.2.0elastic6.3.2
6.4.06.4.0.0elastic6.4.0
6.4.16.4.1.0elastic6.4.1
6.4.26.4.2.0elastic6.4.2
6.4.36.4.3.0elastic6.4.3
6.5.06.5.0.0elastic6.5.0
6.5.16.5.1.0elastic6.5.1
6.5.26.5.2.0elastic6.5.2
6.5.36.5.3.0elastic6.5.3
6.5.46.5.4.0elastic6.5.4
6.6.06.6.0.0elastic6.6.0
6.6.16.6.1.0elastic6.6.1
6.6.26.6.2.0elastic6.6.2
6.7.06.7.0.0elastic6.7.0
6.7.16.7.1.0elastic6.7.1
6.7.26.7.2.0elastic6.7.2
6.8.06.8.0.0elastic6.8.0
6.8.16.8.1.0elastic6.8.1
6.8.26.8.2.0elastic6.8.2
6.8.36.8.3.0elastic6.8.3
6.8.46.8.4.0elastic6.8.4
7.0.07.0.0.0elastic7.0.0
7.0.17.0.1.0elastic7.0.1
7.1.07.1.0.0elastic7.1.0
7.1.17.1.1.0elastic7.1.1
7.2.07.2.0.0elastic7.2.0
7.2.17.2.1.0elastic7.2.1
7.3.07.3.0.0elastic7.3.0
7.3.17.3.1.0elastic7.3.1
7.3.27.3.2.0elastic7.3.2
7.4.07.4.0.0elastic7.4.0
7.4.17.4.1.0elastic7.4.1
7.4.27.4.2.0elastic7.4.2

Elasticsearch 1.x

./bin/plugin -u https://github.com/NLPchina/elasticsearch-sql/releases/download/1.7.6/elasticsearch-sql-1.7.6.zip --install sql

Elasticsearch 2.0.0

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.0.4/elasticsearch-sql-2.0.4.zip 

Elasticsearch 2.1.0

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.1.0.2/elasticsearch-sql-2.1.0.2.zip 

Elasticsearch 2.1.1

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.1.1.1/elasticsearch-sql-2.1.1.1.zip 

Elasticsearch 2.1.2

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.1.2.0/elasticsearch-sql-2.1.2.0.zip 

Elasticsearch 2.2.0

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.2.0.1/elasticsearch-sql-2.2.0.1.zip 

Elasticsearch 2.2.1

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.2.1.0/elasticsearch-sql-2.2.1.0.zip 

Elasticsearch 2.3.0

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.3.0.0/elasticsearch-sql-2.3.0.0.zip 

Elasticsearch 2.3.1

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.3.1.1/elasticsearch-sql-2.3.1.1.zip 

Elasticsearch 2.3.2

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.3.2.0/elasticsearch-sql-2.3.2.0.zip 

Elasticsearch 2.3.3

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.3.3.0/elasticsearch-sql-2.3.3.0.zip 

Elasticsearch 2.3.4

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.3.4.0/elasticsearch-sql-2.3.4.0.zip 

Elasticsearch 2.3.5

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.3.5.0/elasticsearch-sql-2.3.5.0.zip 

Elasticsearch 2.4.0

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.4.0.1/elasticsearch-sql-2.4.0.1.zip

Elasticsearch 2.4.1

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.4.1.0/elasticsearch-sql-2.4.1.0.zip

Elasticsearch 2.4.2

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.4.2.1/elasticsearch-sql-2.4.2.1.zip

Elasticsearch 2.4.3

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.4.3.0/elasticsearch-sql-2.4.3.0.zip

Elasticsearch 2.4.4

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.4.4.0/elasticsearch-sql-2.4.4.0.zip

Elasticsearch 2.4.5

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.4.5.0/elasticsearch-sql-2.4.5.0.zip

Elasticsearch 2.4.6

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.4.6.0/elasticsearch-sql-2.4.6.0.zip

Elasticsearch 5.0.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.0.1/elasticsearch-sql-5.0.1.0.zip

Elasticsearch 5.1.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.1.1.0/elasticsearch-sql-5.1.1.0.zip

Elasticsearch 5.1.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.1.2.0/elasticsearch-sql-5.1.2.0.zip

Elasticsearch 5.2.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.2.0.0/elasticsearch-sql-5.2.0.0.zip

Elasticsearch 5.2.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.2.1.0/elasticsearch-sql-5.2.1.0.zip

Elasticsearch 5.2.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.2.2.0/elasticsearch-sql-5.2.2.0.zip

Elasticsearch 5.3.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.3.0.0/elasticsearch-sql-5.3.0.0.zip

Elasticsearch 5.3.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.3.1.0/elasticsearch-sql-5.3.1.0.zip

Elasticsearch 5.3.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.3.2.0/elasticsearch-sql-5.3.2.0.zip

Elasticsearch 5.3.3

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.3.3.0/elasticsearch-sql-5.3.3.0.zip

Elasticsearch 5.4.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.4.0.0/elasticsearch-sql-5.4.0.0.zip

Elasticsearch 5.4.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.4.1.0/elasticsearch-sql-5.4.1.0.zip

Elasticsearch 5.4.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.4.2.0/elasticsearch-sql-5.4.2.0.zip

Elasticsearch 5.4.3

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.4.3.0/elasticsearch-sql-5.4.3.0.zip

Elasticsearch 5.5.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.5.0.0/elasticsearch-sql-5.5.0.1.zip

Elasticsearch 5.5.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.5.1.0/elasticsearch-sql-5.5.1.0.zip

Elasticsearch 5.5.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.5.2.0/elasticsearch-sql-5.5.2.0.zip

Elasticsearch 5.5.3

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.5.3.0/elasticsearch-sql-5.5.3.0.zip

Elasticsearch 5.6.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.0.0/elasticsearch-sql-5.6.0.0.zip

Elasticsearch 5.6.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.1.0/elasticsearch-sql-5.6.1.0.zip

Elasticsearch 5.6.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.2.0/elasticsearch-sql-5.6.2.0.zip

Elasticsearch 5.6.3

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.3.0/elasticsearch-sql-5.6.3.0.zip

Elasticsearch 5.6.4

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.4.0/elasticsearch-sql-5.6.4.0.zip

Elasticsearch 5.6.5

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.5.0/elasticsearch-sql-5.6.5.0.zip

Elasticsearch 5.6.6

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.6.0/elasticsearch-sql-5.6.6.0.zip

Elasticsearch 5.6.7

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.7.0/elasticsearch-sql-5.6.7.0.zip

Elasticsearch 5.6.8

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.8.0/elasticsearch-sql-5.6.8.0.zip

Elasticsearch 5.6.9

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.9.0/elasticsearch-sql-5.6.9.0.zip

Elasticsearch 5.6.10

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.10.0/elasticsearch-sql-5.6.10.0.zip

Elasticsearch 5.6.11

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.11.0/elasticsearch-sql-5.6.11.0.zip

Elasticsearch 5.6.12

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.12.0/elasticsearch-sql-5.6.12.0.zip

Elasticsearch 5.6.13

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.13.0/elasticsearch-sql-5.6.13.0.zip

Elasticsearch 5.6.14

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.14.0/elasticsearch-sql-5.6.14.0.zip

Elasticsearch 5.6.15

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.15.0/elasticsearch-sql-5.6.15.0.zip

Elasticsearch 5.6.16

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.6.16.0/elasticsearch-sql-5.6.16.0.zip

Elasticsearch 6.0.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.0.0.0/elasticsearch-sql-6.0.0.0.zip

Elasticsearch 6.0.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.0.1.0/elasticsearch-sql-6.0.1.0.zip

Elasticsearch 6.1.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.1.0.0/elasticsearch-sql-6.1.0.0.zip

Elasticsearch 6.1.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.1.1.0/elasticsearch-sql-6.1.1.0.zip

Elasticsearch 6.1.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.1.2.0/elasticsearch-sql-6.1.2.0.zip

Elasticsearch 6.1.3

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.1.3.0/elasticsearch-sql-6.1.3.0.zip

Elasticsearch 6.1.4

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.1.4.0/elasticsearch-sql-6.1.4.0.zip

Elasticsearch 6.2.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.2.0.0/elasticsearch-sql-6.2.0.0.zip

Elasticsearch 6.2.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.2.1.0/elasticsearch-sql-6.2.1.0.zip

Elasticsearch 6.2.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.2.2.0/elasticsearch-sql-6.2.2.0.zip

Elasticsearch 6.2.3

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.2.3.0/elasticsearch-sql-6.2.3.0.zip

Elasticsearch 6.2.4

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.2.4.0/elasticsearch-sql-6.2.4.0.zip

Elasticsearch 6.3.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.3.0.0/elasticsearch-sql-6.3.0.0.zip

Elasticsearch 6.3.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.3.1.0/elasticsearch-sql-6.3.1.1.zip

Elasticsearch 6.3.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.3.2.0/elasticsearch-sql-6.3.2.0.zip

Elasticsearch 6.4.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.4.0.0/elasticsearch-sql-6.4.0.0.zip

Elasticsearch 6.4.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.4.1.0/elasticsearch-sql-6.4.1.0.zip

Elasticsearch 6.4.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.4.2.0/elasticsearch-sql-6.4.2.0.zip

Elasticsearch 6.4.3

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.4.3.0/elasticsearch-sql-6.4.3.0.zip

Elasticsearch 6.5.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.5.0.0/elasticsearch-sql-6.5.0.0.zip

Elasticsearch 6.5.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.5.1.0/elasticsearch-sql-6.5.1.0.zip

Elasticsearch 6.5.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.5.2.0/elasticsearch-sql-6.5.2.0.zip

Elasticsearch 6.5.3

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.5.3.0/elasticsearch-sql-6.5.3.0.zip

Elasticsearch 6.5.4

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.5.4.0/elasticsearch-sql-6.5.4.0.zip

Elasticsearch 6.6.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.6.0.0/elasticsearch-sql-6.6.0.0.zip

Elasticsearch 6.6.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.6.1.0/elasticsearch-sql-6.6.1.0.zip

Elasticsearch 6.6.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.6.2.0/elasticsearch-sql-6.6.2.0.zip

Elasticsearch 6.7.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.7.0.0/elasticsearch-sql-6.7.0.0.zip

Elasticsearch 6.7.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.7.1.0/elasticsearch-sql-6.7.1.0.zip

Elasticsearch 6.7.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.7.2.0/elasticsearch-sql-6.7.2.0.zip

Elasticsearch 6.8.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.8.0.0/elasticsearch-sql-6.8.0.0.zip

Elasticsearch 6.8.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.8.1.0/elasticsearch-sql-6.8.1.0.zip

Elasticsearch 6.8.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.8.2.0/elasticsearch-sql-6.8.2.0.zip

Elasticsearch 6.8.3

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.8.3.0/elasticsearch-sql-6.8.3.0.zip

Elasticsearch 6.8.4

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.8.4.0/elasticsearch-sql-6.8.4.0.zip

Elasticsearch 7.0.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.0.0.0/elasticsearch-sql-7.0.0.0.zip

Elasticsearch 7.0.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.0.1.0/elasticsearch-sql-7.0.1.0.zip

Elasticsearch 7.1.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.1.0.0/elasticsearch-sql-7.1.0.0.zip

Elasticsearch 7.1.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.1.1.0/elasticsearch-sql-7.1.1.0.zip

Elasticsearch 7.2.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.2.0.0/elasticsearch-sql-7.2.0.0.zip

Elasticsearch 7.2.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.2.1.0/elasticsearch-sql-7.2.1.0.zip

Elasticsearch 7.3.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.3.0.0/elasticsearch-sql-7.3.0.0.zip

Elasticsearch 7.3.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.3.1.0/elasticsearch-sql-7.3.1.0.zip

Elasticsearch 7.3.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.3.2.0/elasticsearch-sql-7.3.2.0.zip

Elasticsearch 7.4.0

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.4.0.0/elasticsearch-sql-7.4.0.0.zip

Elasticsearch 7.4.1

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.4.1.0/elasticsearch-sql-7.4.1.0.zip

Elasticsearch 7.4.2

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.4.2.0/elasticsearch-sql-7.4.2.0.zip

After doing this, you need to restart the Elasticsearch server. Otherwise you may get errors like Invalid index name [sql], must not start with '']; ","status":400}.

Basic Usage

On elasticsearch 1.x / 2.x, visit the elasticsearch-sql web front-end:

http://localhost:9200/_plugin/sql/

On elasticsearch 5.x/6.x, use elasticsearch sql site chrome extension (make sure to enable cors on elasticsearch.yml). Alternatively, download and extract site, then start the web front-end like this:

cd site-server
npm install express --save
node node-server.js 
  • Simple query
curl -X GET "localhost:9200/_sql" -H 'Content-Type: application/json' -d'select * from indexName limit 10'
  • Explain SQL to elasticsearch query DSL
curl -X GET "localhost:9200/_sql/_explain" -H 'Content-Type: application/json' -d'select * from indexName limit 10'

SQL Usage

  • Query

     SELECT * FROM bank WHERE age >30 AND gender = 'm'
    
  • Aggregation

     select COUNT(*),SUM(age),MIN(age) as m, MAX(age),AVG(age)
    FROM bank GROUP BY gender ORDER BY SUM(age), m DESC
    
  • Delete

     DELETE FROM bank WHERE age >30 AND gender = 'm'
    

Beyond SQL

  • Search

     SELECT address FROM bank WHERE address = matchQuery('880 Holmes Lane') ORDER BY _score DESC LIMIT 3
    
  • Aggregations

    • range age group 20-25,25-30,30-35,35-40

       SELECT COUNT(age) FROM bank GROUP BY range(age, 20,25,30,35,40)
      
    • range date group by day

       SELECT online FROM online GROUP BY date_histogram(field='insert_time','interval'='1d')
      
    • range date group by your config

       SELECT online FROM online GROUP BY date_range(field='insert_time','format'='yyyy-MM-dd' ,'2014-08-18','2014-08-17','now-8d','now-7d','now-6d','now')
      
  • ES Geographic

     SELECT * FROM locations WHERE GEO_BOUNDING_BOX(fieldname,100.0,1.0,101,0.0)
    
  • Select type

     SELECT * FROM indexName/type
    

SQL Features

  • SQL Select
  • SQL Delete
  • SQL Where
    • can use "case when" in where clause
  • SQL Order By
    • can use "case when" in order by clause
  • SQL Group By
  • SQL AND & OR
  • SQL Like
  • SQL COUNT distinct
  • SQL In
  • SQL Between
  • SQL Aliases
  • SQL Not Null
  • SQL(ES) Date
  • SQL avg()
  • SQL count()
  • SQL last()
  • SQL max()
  • SQL min()
  • SQL sum()
  • SQL Nulls
  • SQL isnull()
  • SQL now()
  • SQL floor
  • SQL split
  • SQL trim
  • SQL log
  • SQL log10
  • SQL substring
  • SQL round
    • eg: round(10.135, 2) --> 10.14
  • SQL sqrt
  • SQL concat_ws
  • SQL union and minus
  • SQL case when
    • can use "in"、"not in" judge in case when clause
    • can execute simple calculation in case when clause, eg : case when 1 = 1 then field_1 + field_2 else 0 end
  • SQL if
    • select if(sex='1','男','女') from t_user;
  • SQL limit
    • can set aggregation bucket size and shard size by setting limit, shardSize = 20 * bucketSize
    • eg: select city,count(*) as user_count from t_user group by city limit 100;
    • on the above example, the bucket size is 100, shard size is 20*100 = 2000

JDBC Support (Experimental feature)

Check details : JDBC Support

Beyond sql features

  • ES TopHits
  • ES MISSING
  • ES STATS
  • ES GEO_INTERSECTS
  • ES GEO_BOUNDING_BOX
  • ES GEO_DISTANCE
  • ES GEOHASH_GRID aggregation

About

Use SQL to query Elasticsearch

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages