Skip to content

Commit

Permalink
Fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasz-antoniak committed Jun 19, 2024
1 parent 3a670f1 commit bb4040b
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions proxy/pkg/zdmproxy/cqlparser_search_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,51 +17,51 @@ func TestParseAndInspect_SearchRequests(t *testing.T) {
tests := []testParams{
{"Query using CONTAINS",
"select * from person where hometown contains 'Bangkok';",
NewGenericRequestInfo(forwardToOrigin, true, true),
NewGenericRequestInfo(forwardToOrigin, true, true, primitive.OpCodeQuery),
},
{"Query using greater and less than",
"select * from person where age > 35 and age < 80;",
NewGenericRequestInfo(forwardToOrigin, true, true),
NewGenericRequestInfo(forwardToOrigin, true, true, primitive.OpCodeQuery),
},
{"Query using basic solr_query clause",
"select * from person where solr_query='firstname: Olga firstname: Raymond -hometown: Bangkok';",
NewGenericRequestInfo(forwardToOrigin, true, true),
NewGenericRequestInfo(forwardToOrigin, true, true, primitive.OpCodeQuery),
},
{"Query using JSON solr_query clause",
"select * from person where solr_query='{\"q\":\"hometown:Bangkok\"}';",
NewGenericRequestInfo(forwardToOrigin, true, true),
NewGenericRequestInfo(forwardToOrigin, true, true, primitive.OpCodeQuery),
},
{"Query using JSON solr_query clause with faceting",
"select * from person where solr_query='{\"q\":\"id:*\",\"facet\":{\"field\":\"hometown\"}}';",
NewGenericRequestInfo(forwardToOrigin, true, true),
NewGenericRequestInfo(forwardToOrigin, true, true, primitive.OpCodeQuery),
},
{"Query using JSON solr_query clause for generic single pass search",
"select * from person where solr_query='{\"q\" : \"*:*\", \"distrib.singlePass\" : true}';",
NewGenericRequestInfo(forwardToOrigin, true, true),
NewGenericRequestInfo(forwardToOrigin, true, true, primitive.OpCodeQuery),
},
{"Query using SAI fuzzy search operator",
"select * from person where nick_name:'fuzzy';",
NewGenericRequestInfo(forwardToOrigin, true, true),
NewGenericRequestInfo(forwardToOrigin, true, true, primitive.OpCodeQuery),
},
{"Query using OR operator in SAI index",
"select * from person where nick_name = 'Foo' or nick_name = 'Bar' and age > 10;",
NewGenericRequestInfo(forwardToOrigin, true, true),
NewGenericRequestInfo(forwardToOrigin, true, true, primitive.OpCodeQuery),
},
{"Query using CONTAINS KEY operator in SAI index",
"SELECT * FROM cyclist_teams WHERE teams CONTAINS KEY 2014;",
NewGenericRequestInfo(forwardToOrigin, true, true),
NewGenericRequestInfo(forwardToOrigin, true, true, primitive.OpCodeQuery),
},
{"Query using CONTAINS operator and UDT",
"SELECT * FROM cycling.cyclist_races WHERE races CONTAINS { race_title:'Rabobank 7-Dorpenomloop Aalburg', race_date:'2015-05-09', race_time:'02:58:33' };",
NewGenericRequestInfo(forwardToOrigin, true, true),
NewGenericRequestInfo(forwardToOrigin, true, true, primitive.OpCodeQuery),
},
{"Query using CONTAINS KEY operator in SAI index",
"SELECT * FROM cyclist_teams WHERE teams CONTAINS 'Team Garmin - Cervelo';",
NewGenericRequestInfo(forwardToOrigin, true, true),
NewGenericRequestInfo(forwardToOrigin, true, true, primitive.OpCodeQuery),
},
{"Query IN operator",
"SELECT * FROM cycling.comments_vs WHERE created_at IN ('2017-03-21 21:11:09.999000+0000', '2017-03-22 01:16:59.001000+0000');",
NewGenericRequestInfo(forwardToOrigin, true, true),
NewGenericRequestInfo(forwardToOrigin, true, true, primitive.OpCodeQuery),
},
}

Expand Down

0 comments on commit bb4040b

Please sign in to comment.