|
|
@ -515,10 +515,8 @@ var cases = []*testIndexerCase{ |
|
|
|
{ |
|
|
|
{ |
|
|
|
Name: "SortByCreatedDesc", |
|
|
|
Name: "SortByCreatedDesc", |
|
|
|
SearchOptions: &internal.SearchOptions{ |
|
|
|
SearchOptions: &internal.SearchOptions{ |
|
|
|
Paginator: &db.ListOptions{ |
|
|
|
Paginator: &db.ListOptionsAll, |
|
|
|
ListAll: true, |
|
|
|
SortBy: internal.SortByCreatedDesc, |
|
|
|
}, |
|
|
|
|
|
|
|
SortBy: internal.SortByCreatedDesc, |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
Expected: func(t *testing.T, data map[int64]*internal.IndexerData, result *internal.SearchResult) { |
|
|
|
Expected: func(t *testing.T, data map[int64]*internal.IndexerData, result *internal.SearchResult) { |
|
|
|
assert.Equal(t, len(data), len(result.Hits)) |
|
|
|
assert.Equal(t, len(data), len(result.Hits)) |
|
|
@ -533,10 +531,8 @@ var cases = []*testIndexerCase{ |
|
|
|
{ |
|
|
|
{ |
|
|
|
Name: "SortByUpdatedDesc", |
|
|
|
Name: "SortByUpdatedDesc", |
|
|
|
SearchOptions: &internal.SearchOptions{ |
|
|
|
SearchOptions: &internal.SearchOptions{ |
|
|
|
Paginator: &db.ListOptions{ |
|
|
|
Paginator: &db.ListOptionsAll, |
|
|
|
ListAll: true, |
|
|
|
SortBy: internal.SortByUpdatedDesc, |
|
|
|
}, |
|
|
|
|
|
|
|
SortBy: internal.SortByUpdatedDesc, |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
Expected: func(t *testing.T, data map[int64]*internal.IndexerData, result *internal.SearchResult) { |
|
|
|
Expected: func(t *testing.T, data map[int64]*internal.IndexerData, result *internal.SearchResult) { |
|
|
|
assert.Equal(t, len(data), len(result.Hits)) |
|
|
|
assert.Equal(t, len(data), len(result.Hits)) |
|
|
@ -551,10 +547,8 @@ var cases = []*testIndexerCase{ |
|
|
|
{ |
|
|
|
{ |
|
|
|
Name: "SortByCommentsDesc", |
|
|
|
Name: "SortByCommentsDesc", |
|
|
|
SearchOptions: &internal.SearchOptions{ |
|
|
|
SearchOptions: &internal.SearchOptions{ |
|
|
|
Paginator: &db.ListOptions{ |
|
|
|
Paginator: &db.ListOptionsAll, |
|
|
|
ListAll: true, |
|
|
|
SortBy: internal.SortByCommentsDesc, |
|
|
|
}, |
|
|
|
|
|
|
|
SortBy: internal.SortByCommentsDesc, |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
Expected: func(t *testing.T, data map[int64]*internal.IndexerData, result *internal.SearchResult) { |
|
|
|
Expected: func(t *testing.T, data map[int64]*internal.IndexerData, result *internal.SearchResult) { |
|
|
|
assert.Equal(t, len(data), len(result.Hits)) |
|
|
|
assert.Equal(t, len(data), len(result.Hits)) |
|
|
@ -569,10 +563,8 @@ var cases = []*testIndexerCase{ |
|
|
|
{ |
|
|
|
{ |
|
|
|
Name: "SortByDeadlineDesc", |
|
|
|
Name: "SortByDeadlineDesc", |
|
|
|
SearchOptions: &internal.SearchOptions{ |
|
|
|
SearchOptions: &internal.SearchOptions{ |
|
|
|
Paginator: &db.ListOptions{ |
|
|
|
Paginator: &db.ListOptionsAll, |
|
|
|
ListAll: true, |
|
|
|
SortBy: internal.SortByDeadlineDesc, |
|
|
|
}, |
|
|
|
|
|
|
|
SortBy: internal.SortByDeadlineDesc, |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
Expected: func(t *testing.T, data map[int64]*internal.IndexerData, result *internal.SearchResult) { |
|
|
|
Expected: func(t *testing.T, data map[int64]*internal.IndexerData, result *internal.SearchResult) { |
|
|
|
assert.Equal(t, len(data), len(result.Hits)) |
|
|
|
assert.Equal(t, len(data), len(result.Hits)) |
|
|
@ -587,10 +579,8 @@ var cases = []*testIndexerCase{ |
|
|
|
{ |
|
|
|
{ |
|
|
|
Name: "SortByCreatedAsc", |
|
|
|
Name: "SortByCreatedAsc", |
|
|
|
SearchOptions: &internal.SearchOptions{ |
|
|
|
SearchOptions: &internal.SearchOptions{ |
|
|
|
Paginator: &db.ListOptions{ |
|
|
|
Paginator: &db.ListOptionsAll, |
|
|
|
ListAll: true, |
|
|
|
SortBy: internal.SortByCreatedAsc, |
|
|
|
}, |
|
|
|
|
|
|
|
SortBy: internal.SortByCreatedAsc, |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
Expected: func(t *testing.T, data map[int64]*internal.IndexerData, result *internal.SearchResult) { |
|
|
|
Expected: func(t *testing.T, data map[int64]*internal.IndexerData, result *internal.SearchResult) { |
|
|
|
assert.Equal(t, len(data), len(result.Hits)) |
|
|
|
assert.Equal(t, len(data), len(result.Hits)) |
|
|
@ -605,10 +595,8 @@ var cases = []*testIndexerCase{ |
|
|
|
{ |
|
|
|
{ |
|
|
|
Name: "SortByUpdatedAsc", |
|
|
|
Name: "SortByUpdatedAsc", |
|
|
|
SearchOptions: &internal.SearchOptions{ |
|
|
|
SearchOptions: &internal.SearchOptions{ |
|
|
|
Paginator: &db.ListOptions{ |
|
|
|
Paginator: &db.ListOptionsAll, |
|
|
|
ListAll: true, |
|
|
|
SortBy: internal.SortByUpdatedAsc, |
|
|
|
}, |
|
|
|
|
|
|
|
SortBy: internal.SortByUpdatedAsc, |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
Expected: func(t *testing.T, data map[int64]*internal.IndexerData, result *internal.SearchResult) { |
|
|
|
Expected: func(t *testing.T, data map[int64]*internal.IndexerData, result *internal.SearchResult) { |
|
|
|
assert.Equal(t, len(data), len(result.Hits)) |
|
|
|
assert.Equal(t, len(data), len(result.Hits)) |
|
|
@ -623,10 +611,8 @@ var cases = []*testIndexerCase{ |
|
|
|
{ |
|
|
|
{ |
|
|
|
Name: "SortByCommentsAsc", |
|
|
|
Name: "SortByCommentsAsc", |
|
|
|
SearchOptions: &internal.SearchOptions{ |
|
|
|
SearchOptions: &internal.SearchOptions{ |
|
|
|
Paginator: &db.ListOptions{ |
|
|
|
Paginator: &db.ListOptionsAll, |
|
|
|
ListAll: true, |
|
|
|
SortBy: internal.SortByCommentsAsc, |
|
|
|
}, |
|
|
|
|
|
|
|
SortBy: internal.SortByCommentsAsc, |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
Expected: func(t *testing.T, data map[int64]*internal.IndexerData, result *internal.SearchResult) { |
|
|
|
Expected: func(t *testing.T, data map[int64]*internal.IndexerData, result *internal.SearchResult) { |
|
|
|
assert.Equal(t, len(data), len(result.Hits)) |
|
|
|
assert.Equal(t, len(data), len(result.Hits)) |
|
|
@ -641,10 +627,8 @@ var cases = []*testIndexerCase{ |
|
|
|
{ |
|
|
|
{ |
|
|
|
Name: "SortByDeadlineAsc", |
|
|
|
Name: "SortByDeadlineAsc", |
|
|
|
SearchOptions: &internal.SearchOptions{ |
|
|
|
SearchOptions: &internal.SearchOptions{ |
|
|
|
Paginator: &db.ListOptions{ |
|
|
|
Paginator: &db.ListOptionsAll, |
|
|
|
ListAll: true, |
|
|
|
SortBy: internal.SortByDeadlineAsc, |
|
|
|
}, |
|
|
|
|
|
|
|
SortBy: internal.SortByDeadlineAsc, |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
Expected: func(t *testing.T, data map[int64]*internal.IndexerData, result *internal.SearchResult) { |
|
|
|
Expected: func(t *testing.T, data map[int64]*internal.IndexerData, result *internal.SearchResult) { |
|
|
|
assert.Equal(t, len(data), len(result.Hits)) |
|
|
|
assert.Equal(t, len(data), len(result.Hits)) |
|
|
|