Test rank handling in all search engines.

Signed-off-by: Eric Peterson <ericpeterson@spotify.com>
This commit is contained in:
Eric Peterson
2022-06-09 17:26:28 +02:00
parent f7f5a6c6a3
commit c7ce7b1eb0
4 changed files with 37 additions and 4 deletions
@@ -431,6 +431,7 @@ describe('LunrSearchEngine', () => {
location: 'test/location',
},
type: 'test-index',
rank: 1,
},
],
nextPageCursor: undefined,
@@ -469,6 +470,7 @@ describe('LunrSearchEngine', () => {
text: 'testText',
location: 'test/location',
},
rank: 1,
},
],
nextPageCursor: undefined,
@@ -521,6 +523,7 @@ describe('LunrSearchEngine', () => {
location: `${highlightTags.pre}test/location${highlightTags.post}`,
},
},
rank: 1,
},
],
nextPageCursor: undefined,
@@ -559,6 +562,7 @@ describe('LunrSearchEngine', () => {
text: 'testText',
location: 'test/location',
},
rank: 1,
},
],
nextPageCursor: undefined,
@@ -598,6 +602,7 @@ describe('LunrSearchEngine', () => {
text: 'testText',
location: 'test/location',
},
rank: 1,
},
],
nextPageCursor: undefined,
@@ -637,6 +642,7 @@ describe('LunrSearchEngine', () => {
text: 'Hello World.',
location: 'test/location',
},
rank: 1,
},
],
nextPageCursor: undefined,
@@ -676,6 +682,7 @@ describe('LunrSearchEngine', () => {
text: 'Searching',
location: 'test/location',
},
rank: 1,
},
],
nextPageCursor: undefined,
@@ -722,6 +729,7 @@ describe('LunrSearchEngine', () => {
text: 'testText',
location: 'test/location2',
},
rank: 1,
},
],
nextPageCursor: undefined,
@@ -777,6 +785,7 @@ describe('LunrSearchEngine', () => {
location: 'test/location2',
extraField: 'testExtraField',
},
rank: 1,
},
],
nextPageCursor: undefined,
@@ -823,6 +832,7 @@ describe('LunrSearchEngine', () => {
text: 'testText',
location: 'test:location2',
},
rank: 1,
},
],
nextPageCursor: undefined,
@@ -886,6 +896,7 @@ describe('LunrSearchEngine', () => {
text: 'testText',
title: 'testTitle',
},
rank: 1,
},
{
document: {
@@ -893,6 +904,7 @@ describe('LunrSearchEngine', () => {
text: 'testText',
title: 'testTitle',
},
rank: 2,
},
],
nextPageCursor: undefined,
@@ -931,6 +943,7 @@ describe('LunrSearchEngine', () => {
location: `test/location/${i}`,
},
type: 'test-index',
rank: i + 1,
})),
nextPageCursor: 'MQ==',
previousPageCursor: undefined,
@@ -968,6 +981,7 @@ describe('LunrSearchEngine', () => {
location: `test/location/${i}`,
},
type: 'test-index',
rank: i + 1,
}))
.slice(25),
nextPageCursor: undefined,