search-backend: use new IndexableResultSet type as return type of engine#query

Signed-off-by: Mike Lewis <mtlewis@users.noreply.github.com>
This commit is contained in:
Mike Lewis
2022-03-11 18:39:39 +00:00
committed by MT Lewis
parent d07ed471dc
commit a0fbae7aeb
2 changed files with 6 additions and 5 deletions
@@ -25,12 +25,12 @@ import {
} from '@backstage/plugin-permission-common';
import {
DocumentTypeInfo,
IndexableResult,
IndexableResultSet,
QueryRequestOptions,
QueryTranslator,
SearchEngine,
SearchQuery,
SearchResult,
SearchResultSet,
} from '@backstage/plugin-search-common';
import { Config } from '@backstage/config';
import { InputError } from '@backstage/errors';
@@ -85,7 +85,7 @@ export class AuthorizedSearchEngine implements SearchEngine {
async query(
query: SearchQuery,
options: QueryRequestOptions,
): Promise<SearchResultSet> {
): Promise<IndexableResultSet> {
const queryStartTime = Date.now();
const authorizer = new DataLoader(
@@ -144,7 +144,7 @@ export class AuthorizedSearchEngine implements SearchEngine {
const { page } = decodePageCursor(query.pageCursor);
const targetResults = (page + 1) * this.pageSize;
let filteredResults: SearchResult[] = [];
let filteredResults: IndexableResult[] = [];
let nextPageCursor: string | undefined;
let latencyBudgetExhausted = false;
@@ -183,7 +183,7 @@ export class AuthorizedSearchEngine implements SearchEngine {
}
private async filterResults(
results: SearchResult[],
results: IndexableResult[],
typeDecisions: Record<string, AuthorizeDecision>,
authorizer: DataLoader<AuthorizeQuery, AuthorizeDecision>,
) {