Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tests due to changing the way of returning documents #289

Merged
merged 1 commit into from
Apr 27, 2022
Merged
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
20 changes: 10 additions & 10 deletions index_search_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ func TestIndex_Search(t *testing.T) {
want: &SearchResponse{
Hits: []interface{}{
map[string]interface{}{
"book_id": float64(1), "title": "Alice In Wonderland",
"book_id": float64(123), "title": "Pride and Prejudice",
},
},
NbHits: 20,
Expand Down Expand Up @@ -191,15 +191,15 @@ func TestIndex_Search(t *testing.T) {
},
want: &SearchResponse{
Hits: []interface{}{
map[string]interface{}{
"book_id": float64(1032), "title": "Crime and Punishment",
},
map[string]interface{}{
"book_id": float64(123), "title": "Pride and Prejudice",
},
map[string]interface{}{
"book_id": float64(730), "title": "War and Peace",
},
map[string]interface{}{
"book_id": float64(1032), "title": "Crime and Punishment",
},
map[string]interface{}{
"book_id": float64(4), "title": "Harry Potter and the Half-Blood Prince",
},
Expand Down Expand Up @@ -532,13 +532,13 @@ func TestIndex_SearchWithFilters(t *testing.T) {
want: &SearchResponse{
Hits: []interface{}{
map[string]interface{}{
"book_id": float64(17), "title": "In Search of Lost Time",
"book_id": float64(742), "title": "The Great Gatsby",
},
map[string]interface{}{
"book_id": float64(204), "title": "Ulysses",
"book_id": float64(17), "title": "In Search of Lost Time",
},
map[string]interface{}{
"book_id": float64(742), "title": "The Great Gatsby",
"book_id": float64(204), "title": "Ulysses",
},
},
NbHits: 3,
Expand Down Expand Up @@ -590,13 +590,13 @@ func TestIndex_SearchWithFilters(t *testing.T) {
want: &SearchResponse{
Hits: []interface{}{
map[string]interface{}{
"book_id": float64(1), "title": "Alice In Wonderland",
"book_id": float64(456), "title": "Le Petit Prince",
},
map[string]interface{}{
"book_id": float64(4), "title": "Harry Potter and the Half-Blood Prince",
"book_id": float64(1), "title": "Alice In Wonderland",
},
map[string]interface{}{
"book_id": float64(456), "title": "Le Petit Prince",
"book_id": float64(4), "title": "Harry Potter and the Half-Blood Prince",
},
},
NbHits: 3,
Expand Down