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