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:
fengmk2
2025-06-20 19:29:37 +08:00
committed by GitHub
parent 10e981aa6d
commit 011f92f7da
9 changed files with 430 additions and 0 deletions
+21
View File
@@ -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