Skip to content

Commit

Permalink
Add test case for filter query containing space.
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulKovalov committed Oct 7, 2021
1 parent 240e0e3 commit f8c4b77
Showing 1 changed file with 31 additions and 7 deletions.
38 changes: 31 additions & 7 deletions index_search_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,31 @@ func TestIndex_SearchWithFilters(t *testing.T) {
ExhaustiveNbHits: false,
},
},
{
name: "TestIndexSearchWithFilterContainingSpaces",
args: args{
UID: "indexUID",
client: defaultClient,
query: "and",
filterableAttributes: []string{
"tag",
},
request: SearchRequest{
Filter: "tag = 'Crime fiction'",
},
},
want: &SearchResponse{
Hits: []interface{}{
map[string]interface{}{
"book_id": float64(1032), "title": "Crime and Punishment",
},
},
NbHits: 1,
Offset: 0,
Limit: 20,
ExhaustiveNbHits: false,
},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
Expand Down Expand Up @@ -661,15 +686,14 @@ func TestIndex_SearchWithFilters(t *testing.T) {
}
}


func TestIndex_SearchWithSort(t *testing.T) {
type args struct {
UID string
PrimaryKey string
client *Client
query string
sortableAttributes []string
request SearchRequest
UID string
PrimaryKey string
client *Client
query string
sortableAttributes []string
request SearchRequest
}
tests := []struct {
name string
Expand Down

0 comments on commit f8c4b77

Please sign in to comment.