Skip to content

Commit a8c2285

Browse files
committed
UPDATE README and version
1 parent 5ca56b0 commit a8c2285

File tree

2 files changed

+41
-62
lines changed

2 files changed

+41
-62
lines changed

README.md

Lines changed: 34 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,104 +1,79 @@
1-
elasticsearch-sql
1+
Elasticsearch-SQL
22
=================
33

4-
> use elasticsearch like sql , and use es function in sql .
5-
>
6-
> it dev on elasticsearch 1.3.2 jdk 1.7
7-
>
8-
> run on elasticsearch 1.x jdk7
9-
>
10-
> can run client or plugin on server
11-
>
12-
> ###thanks by @温少 and @elasticsearch @Medcl
4+
Query elasticsearch using familiar SQL syntax.
5+
You can also use ES functions in SQL.
136

147

15-
# SETUP
8+
## SETUP
169

17-
* plug
10+
Install as plugin:
1811

19-
###1.3.2
20-
````
21-
22-
./bin/plugin -u http://maven.nlpcn.org/org/nlpcn/elasticsearch-sql/1.3.2/elasticsearch-sql-1.3.2.zip --install sql
23-
24-
````
25-
26-
###1.4.1
12+
###Elasticsearch 1.4.X
2713
````
2814
2915
./bin/plugin -u http://maven.nlpcn.org/org/nlpcn/elasticsearch-sql/1.4.1/elasticsearch-sql-1.4.1.zip --install sql
3016
3117
````
18+
## Basic Usuage
3219

33-
* visit by web site
34-
20+
* Visit The elasticsearch-sql web front end:
3521
````
36-
3722
http://localhost:9200/_plugin/sql/
38-
3923
````
4024

4125

42-
43-
44-
* search by search
45-
26+
* Simple query
4627
````
47-
48-
http://localhost:9200/_sql?sql=select * from indexName limit 10
49-
28+
http://localhost:9200/_sql?sql=select * from indexName limit 10
5029
````
5130

52-
* explain sql to es script
53-
31+
* Explain SQL to elasticsearch query DSL
5432
````
55-
http://localhost:9200/_sql/_explain?sql=select * from indexName limit 10
56-
33+
http://localhost:9200/_sql/_explain?sql=select * from indexName limit 10
5734
````
5835

5936

6037

61-
# Simple Case
62-
63-
==================
64-
65-
> ###you can use it by sql .
38+
## SQL Usuage
6639

6740
* Query
6841

69-
select * from blank where age >30 and gender ="m" ;
42+
SELECT * FROM bank WHERE age >30 AND gender = 'm'
7043

7144
* Aggregation
7245

73-
select count(*),sum(age),min(age) as m,max(age),avg(age) from bank group by gender order by sum(age),m desc
46+
select COUNT(*),SUM(age),MIN(age) as m, MAX(age),AVG(age)
47+
FROM bank GROUP BY gender ORDER BY SUM(age), m DESC
7448

75-
> ###beyond sql
49+
> ###Beyond sql
7650
7751
* Search
7852

79-
select address from bank where address= matchQuery('880 Holmes Lane') order by _score desc limit 3
53+
SELECT address FROM bank WHERE address = matchQuery('880 Holmes Lane') ORDER BY _score DESC LIMIT 3
8054
8155

82-
* expand Aggregation Range
83-
56+
* Group by aggregation
57+
8458
+ range age group 20-25,25-30,30-35,35-40
8559

86-
select count(age) from bank group by range(age, 20,25,30,35,40)
60+
SELECT COUNT(age) FROM bank GROUP BY range(age, 20,25,30,35,40)
8761

62+
+ range date group by day
8863

89-
+ range date group by day
90-
91-
select online from online group by date_histogram(field='insert_time','interval'='1d')
64+
SELECT online FROM online GROUP BY date_histogram(field='insert_time','interval'='1d')
9265

9366
+ range date group by your config
94-
95-
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')
9667

68+
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')
9769

70+
* Select type
9871

99-
# NOW
72+
SELECT * FROM indexName/type
73+
74+
75+
## Features
10076

101-
> 列出已经实现的功能
10277
* ES TopHits
10378
* ES MISS
10479
* SQL select
@@ -107,7 +82,6 @@ http://localhost:9200/_sql/_explain?sql=select * from indexName limit 10
10782
* SQL AND & OR
10883
* SQL Order By
10984
* SQL Like
110-
* SQL 通配符
11185
* SQL In
11286
* SQL Between
11387
* SQL Aliases
@@ -124,9 +98,9 @@ http://localhost:9200/_sql/_explain?sql=select * from indexName limit 10
12498
* SQL Group By
12599
* SQL now()
126100

127-
# FEATURE
128101

129-
* SQL insert
130-
* SQL update
131-
* SQL delete
132-
* ES functions
102+
103+
104+
## Web frontend overview
105+
106+
![Web frontend overview](https://cloud.githubusercontent.com/assets/9518816/5555009/ebe4b53c-8c93-11e4-88ad-96d805cc698f.png)

pom.xml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>org.nlpcn</groupId>
55
<artifactId>elasticsearch-sql</artifactId>
6-
<version>1.4.1</version>
6+
<version>1.2</version>
77
<packaging>jar</packaging>
8-
<description>elasticsearh by sql ! </description>
8+
<description>Query elasticsearch using SQL</description>
99
<name>elasticsearch-sql</name>
1010
<url>https://github.com/NLPchina/elasticsearch-sql/</url>
1111
<licenses>
@@ -22,6 +22,11 @@
2222
<name>ansj</name>
2323
<email>[email protected]</email>
2424
</developer>
25+
<developer>
26+
<id>omershelef</id>
27+
<name>Omer shelef</name>
28+
<email>[email protected]</email>
29+
</developer>
2530
</developers>
2631

2732
<distributionManagement>

0 commit comments

Comments
 (0)