cursor pagination
Signed-off-by: Eric Peterson <ericpeterson@spotify.com>
This commit is contained in:
committed by
Eric Peterson
parent
779a164507
commit
f9b203e07e
@@ -35,11 +35,11 @@ export async function createRouter({
|
||||
res: express.Response<SearchResultSet>,
|
||||
) => {
|
||||
// TODO: Actually transform req.params into search engine specific query.
|
||||
const { term, filters = {}, pageIndex = 0, pageSize = 30 } = req.query;
|
||||
const { term, filters = {}, pageCursor = '' } = req.query;
|
||||
logger.info(
|
||||
`Search request received: ${term}, ${JSON.stringify(
|
||||
filters,
|
||||
)}, ${pageIndex}, ${pageSize}`,
|
||||
)}, ${pageCursor}`,
|
||||
);
|
||||
|
||||
try {
|
||||
|
||||
@@ -20,8 +20,7 @@ import { IndexableDocument } from '@backstage/plugin-search-indexer-backend';
|
||||
export interface SearchQuery {
|
||||
term: string;
|
||||
filters?: JsonObject;
|
||||
pageIndex?: number;
|
||||
pageSize?: number;
|
||||
pageCursor: string;
|
||||
}
|
||||
|
||||
export interface SearchResult {
|
||||
|
||||
Reference in New Issue
Block a user