Support for filter by parent document (#6850)

* Backend support for filter by parent document

* parentDocumentId -> documentId
This commit is contained in:
Tom Moor
2024-04-25 22:44:15 -04:00
committed by GitHub
parent 3f4583ce72
commit 958cf45d74
14 changed files with 145 additions and 45 deletions

View File

@@ -40,6 +40,8 @@ type SearchOptions = {
dateFilter?: DateFilter;
/** Status of the documents to return */
statusFilter?: StatusFilter[];
/** Limit results to a list of documents. */
documentIds?: string[];
/** Limit results to a list of users that collaborated on the document. */
collaboratorIds?: string[];
/** The minimum number of words to be returned in the contextual snippet */
@@ -367,6 +369,12 @@ export default class SearchHelper {
});
}
if (options.documentIds) {
where[Op.and].push({
id: options.documentIds,
});
}
const statusQuery = [];
if (options.statusFilter?.includes(StatusFilter.Published)) {
statusQuery.push({