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

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/java/org/nlpcn/es4sql/parse/SqlParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ private void parseWhere(SQLBinaryOpExpr expr, SQLBinaryOpExpr sub, Where where)
if (isCond(sub)) {
explanCond(expr.operator.name, sub, where);
} else {
if (sub.operator.priority > expr.operator.priority) {
if (sub.operator.priority != expr.operator.priority) {
Where subWhere = new Where(expr.getOperator().name);
where.addWhere(subWhere);
parseWhere(sub, subWhere);
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/org/nlpcn/es4sql/QueryTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ public void testMultipartWhere() throws IOException, SqlParseException, SQLFeatu
@Test
public void testMultipartWhere2() throws IOException, SqlParseException, SQLFeatureNotSupportedException{
SearchHits response = query(String.format("SELECT * FROM %s/account where ((account_number > 200 and account_number < 300) or gender like 'm') and (state like 'hi' or address like 'avenue')", TEST_INDEX));
Assert.assertEquals(11, response.getTotalHits());
Assert.assertEquals(127, response.getTotalHits());
}

@Test
Expand Down