feat(search-backend-node): check types in error handling
Co-authored-by: Emma Indal <emma.indahl@gmail.com> Signed-off-by: Camila Belo <camilaibs@gmail.com>
This commit is contained in:
@@ -168,7 +168,7 @@ export class LunrSearchEngine implements SearchEngine {
|
||||
type => !documentTypes || documentTypes.includes(type),
|
||||
);
|
||||
|
||||
if (!indexKeys.length) {
|
||||
if (documentTypes?.length && !indexKeys.length) {
|
||||
throw new MissingIndexError(
|
||||
`Missing index for ${documentTypes?.toString()}. This means there are no documents to search through.`,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user