mirror of
https://github.com/docmost/docmost.git
synced 2026-09-11 07:56:54 +08:00
feat(EE): full-text search in attachments (#1502)
* feat(EE): fulltext search in attachments * feat: global search - search filters - attachments search ui - and more * fix import * fix import * rename migration * add GIN index * fix table name * sanitize
This commit is contained in:
@@ -1,15 +1,17 @@
|
||||
import { useQuery, UseQueryResult } from "@tanstack/react-query";
|
||||
import {
|
||||
searchAttachments,
|
||||
searchPage,
|
||||
searchShare,
|
||||
searchSuggestions,
|
||||
} from "@/features/search/services/search-service";
|
||||
} from '@/features/search/services/search-service';
|
||||
import {
|
||||
IAttachmentSearch,
|
||||
IPageSearch,
|
||||
IPageSearchParams,
|
||||
ISuggestionResult,
|
||||
SearchSuggestionParams,
|
||||
} from "@/features/search/types/search.types";
|
||||
} from '@/features/search/types/search.types';
|
||||
|
||||
export function usePageSearchQuery(
|
||||
params: IPageSearchParams,
|
||||
@@ -41,3 +43,13 @@ export function useShareSearchQuery(
|
||||
enabled: !!params.query,
|
||||
});
|
||||
}
|
||||
|
||||
export function useAttachmentSearchQuery(
|
||||
params: IPageSearchParams,
|
||||
): UseQueryResult<IAttachmentSearch[], Error> {
|
||||
return useQuery({
|
||||
queryKey: ["attachment-search", params],
|
||||
queryFn: () => searchAttachments(params),
|
||||
enabled: !!params.query,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user