mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-29 16:19:43 +08:00
feat(server): add search docs by keyword gql api (#12866)
close AI-220 #### PR Dependency Tree * **PR #12866** 👈 This tree was auto-generated by [Charcoal](https://github.com/danerwilliams/charcoal) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced a new document search capability, allowing users to search for documents by keyword within a workspace. - Search results include document details such as title, highlights, creation and update timestamps, and creator/updater information. - Added support for limiting the number of search results returned. - **Tests** - Added comprehensive end-to-end and snapshot tests to ensure accuracy and access control for the new search functionality. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -1502,6 +1502,24 @@ type SameSubscriptionRecurringDataType {
|
||||
recurring: String!
|
||||
}
|
||||
|
||||
type SearchDocObjectType {
|
||||
blockId: String!
|
||||
createdAt: DateTime!
|
||||
createdByUser: PublicUserType
|
||||
docId: String!
|
||||
highlight: String!
|
||||
title: String!
|
||||
updatedAt: DateTime!
|
||||
updatedByUser: PublicUserType
|
||||
}
|
||||
|
||||
input SearchDocsInput {
|
||||
keyword: String!
|
||||
|
||||
"""Limit the number of docs to return, default is 20"""
|
||||
limit: Int
|
||||
}
|
||||
|
||||
input SearchHighlight {
|
||||
before: String!
|
||||
end: String!
|
||||
@@ -2074,6 +2092,9 @@ type WorkspaceType {
|
||||
"""Search a specific table"""
|
||||
search(input: SearchInput!): SearchResultObjectType!
|
||||
|
||||
"""Search docs by keyword"""
|
||||
searchDocs(input: SearchDocsInput!): [SearchDocObjectType!]!
|
||||
|
||||
"""The team subscription of the workspace, if exists."""
|
||||
subscription: SubscriptionType
|
||||
|
||||
|
||||
Reference in New Issue
Block a user