@@ -796,17 +796,18 @@ public void nestedEqualsTestFieldInsideArrays() throws IOException, SqlParseExce
796
796
Assert .assertEquals (2 , response .getTotalHits ());
797
797
}
798
798
799
- @ Test
800
- public void nestedOnInQuery () throws IOException , SqlParseException , SQLFeatureNotSupportedException {
801
- SearchHits response = query (String .format ("SELECT * FROM %s/nestedType where nested(message.info) in ('a','b')" , TEST_INDEX ));
802
- Assert .assertEquals (3 , response .getTotalHits ());
803
- }
799
+ // @Test
800
+ // public void nestedOnInQuery() throws IOException, SqlParseException, SQLFeatureNotSupportedException{
801
+ // SearchHits response = query(String.format("SELECT * FROM %s/nestedType where nested(message.info) in ('a','b')", TEST_INDEX));
802
+ // Assert.assertEquals(3, response.getTotalHits());
803
+ // }
804
804
805
805
@ Test
806
806
public void complexNestedQueryBothOnSameObject () throws IOException , SqlParseException , SQLFeatureNotSupportedException {
807
807
SearchHits response = query (String .format ("SELECT * FROM %s/nestedType where nested('message',message.info = 'a' and message.author ='i' ) " , TEST_INDEX ));
808
808
Assert .assertEquals (1 , response .getTotalHits ());
809
809
}
810
+
810
811
@ Test
811
812
public void complexNestedQueryNotBothOnSameObject () throws IOException , SqlParseException , SQLFeatureNotSupportedException {
812
813
SearchHits response = query (String .format ("SELECT * FROM %s/nestedType where nested('message',message.info = 'a' and message.author ='h' ) " , TEST_INDEX ));
@@ -819,6 +820,36 @@ public void nestedOnInTermsQuery() throws IOException, SqlParseException, SQLFea
819
820
Assert .assertEquals (3 , response .getTotalHits ());
820
821
}
821
822
823
+ @ Test
824
+ public void childrenEqualsTestFieldNormalField () throws IOException , SqlParseException , SQLFeatureNotSupportedException {
825
+ SearchHits response = query (String .format ("SELECT * FROM %s/parentType where children(childrenType, info)='b'" , TEST_INDEX ));
826
+ Assert .assertEquals (1 , response .getTotalHits ());
827
+ }
828
+
829
+ @ Test
830
+ public void childrenOnInQuery () throws IOException , SqlParseException , SQLFeatureNotSupportedException {
831
+ SearchHits response = query (String .format ("SELECT * FROM %s/parentType where children(childrenType, info) in ('a','b')" , TEST_INDEX ));
832
+ Assert .assertEquals (2 , response .getTotalHits ());
833
+ }
834
+
835
+ @ Test
836
+ public void complexChildrenQueryBothOnSameObject () throws IOException , SqlParseException , SQLFeatureNotSupportedException {
837
+ SearchHits response = query (String .format ("SELECT * FROM %s/parentType where children(childrenType, info = 'a' and author ='e' ) " , TEST_INDEX ));
838
+ Assert .assertEquals (1 , response .getTotalHits ());
839
+ }
840
+
841
+ @ Test
842
+ public void complexChildrenQueryNotBothOnSameObject () throws IOException , SqlParseException , SQLFeatureNotSupportedException {
843
+ SearchHits response = query (String .format ("SELECT * FROM %s/parentType where children(childrenType, info = 'a' and author ='j' ) " , TEST_INDEX ));
844
+ Assert .assertEquals (0 , response .getTotalHits ());
845
+ }
846
+
847
+ @ Test
848
+ public void childrenOnInTermsQuery () throws IOException , SqlParseException , SQLFeatureNotSupportedException {
849
+ SearchHits response = query (String .format ("SELECT * FROM %s/parentType where children(childrenType, info) = IN_TERMS(a,b)" , TEST_INDEX ));
850
+ Assert .assertEquals (2 , response .getTotalHits ());
851
+ }
852
+
822
853
@ Test
823
854
public void multipleIndicesOneNotExistWithHint () throws IOException , SqlParseException , SQLFeatureNotSupportedException {
824
855
SearchHits response = query (String .format ("SELECT /*! IGNORE_UNAVAILABLE */ * FROM %s,%s " , TEST_INDEX ,"badindex" ));
0 commit comments