Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 316c18e

Browse files
committed
Merge commit '2286659420d1192abc687bd0772cd72cf725cb0d' into elastic2.0
2 parents d303781 + 2286659 commit 316c18e

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ Versions
2828
| 2.0.0 | 2.0.3 | delete commands not supported | elastic2.0 |
2929
| 2.1.0 | 2.1.0.1 | delete commands not supported | elastic2.1 |
3030
| 2.1.1 | 2.1.1 | delete commands not supported | elastic2.1.1 |
31+
| 2.2.0 | 2.2.0 | delete commands not supported | elastic2.2.0 |
3132

3233
### Elasticsearch 1.X
3334
````
@@ -45,6 +46,10 @@ Versions
4546
````
4647
./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.1.1/elasticsearch-sql-2.1.1.zip
4748
````
49+
### Elasticsearch 2.2.0
50+
````
51+
./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.2.0/elasticsearch-sql-2.2.0.zip
52+
````
4853
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}`.
4954

5055
## Basic Usage

src/main/java/org/nlpcn/es4sql/parse/ElasticLexer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,6 @@ public void scanIdentifier() {
8888

8989

9090
private boolean isElasticIdentifierChar(char ch) {
91-
return ch == '*' || ch == ':' || ch == '-' || ch == '.' || isIdentifierChar(ch);
91+
return ch == '*' || ch == ':' || ch == '-' || ch == '.' || ch == ';' || isIdentifierChar(ch);
9292
}
9393
}

src/test/java/org/nlpcn/es4sql/SqlParserTests.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,14 +413,23 @@ public void innerQueryTestTwoQueries() throws SqlParseException {
413413
}
414414

415415
@Test
416-
public void indexWithDotsAndHyphen() throws SqlParseException {
416+
public void indexWithDotsAndHyphen() throws SqlParseException {
417417
String query = "select * from data-2015.08.22";
418418
SQLExpr sqlExpr = queryToExpr(query);
419419
Select select = parser.parseSelect((SQLQueryExpr) sqlExpr);
420420
Assert.assertEquals(1,select.getFrom().size());
421421
Assert.assertEquals("data-2015.08.22",select.getFrom().get(0).getIndex());
422422
}
423423

424+
@Test
425+
public void indexWithSemiColons() throws SqlParseException {
426+
String query = "select * from some;index";
427+
SQLExpr sqlExpr = queryToExpr(query);
428+
Select select = parser.parseSelect((SQLQueryExpr) sqlExpr);
429+
Assert.assertEquals(1,select.getFrom().size());
430+
Assert.assertEquals("some;index",select.getFrom().get(0).getIndex());
431+
}
432+
424433
@Test
425434
public void scriptFiledPlusLiteralTest() throws SqlParseException {
426435
String query = "SELECT field1 + 3 FROM index/type";

0 commit comments

Comments
 (0)