mirror of
https://github.com/docmost/docmost.git
synced 2026-08-26 00:07:04 +08:00
feat: add title-only search mode
Adds a titleOnly flag to page search: the Postgres driver matches titles via trigram-indexed unaccented LIKE ranked by word_similarity, and a Match filter in the search spotlight switches between everything and title-only matching.
This commit is contained in:
@@ -33,6 +33,7 @@ export function SearchSpotlight({ spaceId }: SearchSpotlightProps) {
|
||||
contentType?: string;
|
||||
creatorId?: string | null;
|
||||
labelIds?: string[];
|
||||
titleOnly?: boolean;
|
||||
}>({
|
||||
contentType: "page",
|
||||
});
|
||||
@@ -58,6 +59,10 @@ export function SearchSpotlight({ spaceId }: SearchSpotlightProps) {
|
||||
params.labelIds = filters.labelIds;
|
||||
}
|
||||
|
||||
if (filters.titleOnly) {
|
||||
params.titleOnly = true;
|
||||
}
|
||||
|
||||
return params;
|
||||
}, [debouncedSearchQuery, filters]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user