feat(server): add cloud indexer with Elasticsearch and Manticoresearch providers (#11835)

close CLOUD-137

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit

- **New Features**
  - Introduced advanced workspace-scoped search and aggregation capabilities with support for complex queries, highlights, and pagination.
  - Added pluggable search providers: Elasticsearch and Manticoresearch.
  - New GraphQL queries, schema types, and resolver support for search and aggregation.
  - Enhanced configuration options for search providers in self-hosted and cloud deployments.
  - Added Docker Compose services and environment variables for Elasticsearch and Manticoresearch.
  - Integrated indexer service into deployment and CI workflows.

- **Bug Fixes**
  - Improved error handling with new user-friendly error messages for search provider and indexer issues.

- **Documentation**
  - Updated configuration examples and environment variable references for indexer and search providers.

- **Tests**
  - Added extensive end-to-end and provider-specific tests covering indexing, searching, aggregation, deletion, and error cases.
  - Included snapshot tests and test fixtures for search providers.

- **Chores**
  - Updated deployment scripts, Helm charts, and Kubernetes manifests to include indexer-related environment variables and secrets.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
fengmk2
2025-05-14 14:52:40 +00:00
parent 7c22b3931f
commit a1bcf77447
66 changed files with 10139 additions and 10 deletions

View File

@@ -19,6 +19,46 @@ input AddContextFileInput {
contextId: String!
}
type AggregateBucketHitsObjectType {
nodes: [SearchNodeObjectType!]!
}
type AggregateBucketObjectType {
count: Int!
"""The hits object"""
hits: AggregateBucketHitsObjectType!
key: String!
}
input AggregateHitsOptions {
fields: [String!]!
highlights: [SearchHighlight!]
pagination: AggregateHitsPagination
}
input AggregateHitsPagination {
limit: Int
skip: Int
}
input AggregateInput {
field: String!
options: AggregateOptions!
query: SearchQuery!
table: SearchTable!
}
input AggregateOptions {
hits: AggregateHitsOptions!
pagination: SearchPagination
}
type AggregateResultObjectType {
buckets: [AggregateBucketObjectType!]!
pagination: SearchResultPagination!
}
enum AiJobStatus {
claimed
failed
@@ -475,7 +515,7 @@ type EditorType {
name: String!
}
union ErrorDataUnion = AlreadyInSpaceDataType | BlobNotFoundDataType | CopilotContextFileNotSupportedDataType | CopilotDocNotFoundDataType | CopilotFailedToAddWorkspaceFileEmbeddingDataType | CopilotFailedToMatchContextDataType | CopilotFailedToMatchGlobalContextDataType | CopilotFailedToModifyContextDataType | CopilotInvalidContextDataType | CopilotMessageNotFoundDataType | CopilotPromptNotFoundDataType | CopilotProviderSideErrorDataType | DocActionDeniedDataType | DocHistoryNotFoundDataType | DocNotFoundDataType | DocUpdateBlockedDataType | ExpectToGrantDocUserRolesDataType | ExpectToRevokeDocUserRolesDataType | ExpectToUpdateDocUserRoleDataType | GraphqlBadRequestDataType | HttpRequestErrorDataType | InvalidEmailDataType | InvalidHistoryTimestampDataType | InvalidLicenseToActivateDataType | InvalidLicenseUpdateParamsDataType | InvalidOauthCallbackCodeDataType | InvalidPasswordLengthDataType | InvalidRuntimeConfigTypeDataType | MemberNotFoundInSpaceDataType | MentionUserDocAccessDeniedDataType | MissingOauthQueryParameterDataType | NoMoreSeatDataType | NotInSpaceDataType | QueryTooLongDataType | RuntimeConfigNotFoundDataType | SameSubscriptionRecurringDataType | SpaceAccessDeniedDataType | SpaceNotFoundDataType | SpaceOwnerNotFoundDataType | SpaceShouldHaveOnlyOneOwnerDataType | SubscriptionAlreadyExistsDataType | SubscriptionNotExistsDataType | SubscriptionPlanNotFoundDataType | UnknownOauthProviderDataType | UnsupportedClientVersionDataType | UnsupportedSubscriptionPlanDataType | ValidationErrorDataType | VersionRejectedDataType | WorkspacePermissionNotFoundDataType | WrongSignInCredentialsDataType
union ErrorDataUnion = AlreadyInSpaceDataType | BlobNotFoundDataType | CopilotContextFileNotSupportedDataType | CopilotDocNotFoundDataType | CopilotFailedToAddWorkspaceFileEmbeddingDataType | CopilotFailedToMatchContextDataType | CopilotFailedToMatchGlobalContextDataType | CopilotFailedToModifyContextDataType | CopilotInvalidContextDataType | CopilotMessageNotFoundDataType | CopilotPromptNotFoundDataType | CopilotProviderSideErrorDataType | DocActionDeniedDataType | DocHistoryNotFoundDataType | DocNotFoundDataType | DocUpdateBlockedDataType | ExpectToGrantDocUserRolesDataType | ExpectToRevokeDocUserRolesDataType | ExpectToUpdateDocUserRoleDataType | GraphqlBadRequestDataType | HttpRequestErrorDataType | InvalidEmailDataType | InvalidHistoryTimestampDataType | InvalidIndexerInputDataType | InvalidLicenseToActivateDataType | InvalidLicenseUpdateParamsDataType | InvalidOauthCallbackCodeDataType | InvalidPasswordLengthDataType | InvalidRuntimeConfigTypeDataType | InvalidSearchProviderRequestDataType | MemberNotFoundInSpaceDataType | MentionUserDocAccessDeniedDataType | MissingOauthQueryParameterDataType | NoMoreSeatDataType | NotInSpaceDataType | QueryTooLongDataType | RuntimeConfigNotFoundDataType | SameSubscriptionRecurringDataType | SpaceAccessDeniedDataType | SpaceNotFoundDataType | SpaceOwnerNotFoundDataType | SpaceShouldHaveOnlyOneOwnerDataType | SubscriptionAlreadyExistsDataType | SubscriptionNotExistsDataType | SubscriptionPlanNotFoundDataType | UnknownOauthProviderDataType | UnsupportedClientVersionDataType | UnsupportedSubscriptionPlanDataType | ValidationErrorDataType | VersionRejectedDataType | WorkspacePermissionNotFoundDataType | WrongSignInCredentialsDataType
enum ErrorNames {
ACCESS_DENIED
@@ -544,6 +584,7 @@ enum ErrorNames {
INVALID_EMAIL
INVALID_EMAIL_TOKEN
INVALID_HISTORY_TIMESTAMP
INVALID_INDEXER_INPUT
INVALID_INVITATION
INVALID_LICENSE_SESSION_ID
INVALID_LICENSE_TO_ACTIVATE
@@ -552,6 +593,7 @@ enum ErrorNames {
INVALID_OAUTH_CALLBACK_STATE
INVALID_PASSWORD_LENGTH
INVALID_RUNTIME_CONFIG_TYPE
INVALID_SEARCH_PROVIDER_REQUEST
INVALID_SUBSCRIPTION_PARAMETERS
LICENSE_EXPIRED
LICENSE_NOT_FOUND
@@ -578,6 +620,7 @@ enum ErrorNames {
RUNTIME_CONFIG_NOT_FOUND
SAME_EMAIL_PROVIDED
SAME_SUBSCRIPTION_RECURRING
SEARCH_PROVIDER_NOT_FOUND
SIGN_UP_FORBIDDEN
SPACE_ACCESS_DENIED
SPACE_NOT_FOUND
@@ -683,6 +726,10 @@ type InvalidHistoryTimestampDataType {
timestamp: String!
}
type InvalidIndexerInputDataType {
reason: String!
}
type InvalidLicenseToActivateDataType {
reason: String!
}
@@ -707,6 +754,11 @@ type InvalidRuntimeConfigTypeDataType {
want: String!
}
type InvalidSearchProviderRequestDataType {
reason: String!
type: String!
}
type InvitationAcceptedNotificationBodyType {
"""
The user who created the notification, maybe null when user is deleted or sent by system
@@ -1403,6 +1455,81 @@ type SameSubscriptionRecurringDataType {
recurring: String!
}
input SearchHighlight {
before: String!
end: String!
field: String!
}
input SearchInput {
options: SearchOptions!
query: SearchQuery!
table: SearchTable!
}
type SearchNodeObjectType {
"""The search result fields, see UnionSearchItemObjectType"""
fields: JSONObject!
"""The search result fields, see UnionSearchItemObjectType"""
highlights: JSONObject
}
input SearchOptions {
fields: [String!]!
highlights: [SearchHighlight!]
pagination: SearchPagination
}
input SearchPagination {
cursor: String
limit: Int
skip: Int
}
input SearchQuery {
boost: Float
field: String
match: String
occur: SearchQueryOccur
queries: [SearchQuery!]
query: SearchQuery
type: SearchQueryType!
}
"""Search query occur"""
enum SearchQueryOccur {
must
must_not
should
}
"""Search query type"""
enum SearchQueryType {
all
boolean
boost
exists
match
}
type SearchResultObjectType {
nodes: [SearchNodeObjectType!]!
pagination: SearchResultPagination!
}
type SearchResultPagination {
count: Int!
hasMore: Boolean!
nextCursor: String
}
"""Search table"""
enum SearchTable {
block
doc
}
type ServerConfigType {
"""fetch latest available upgradable release of server"""
availableUpgrade: ReleaseVersionType
@@ -1441,6 +1568,7 @@ enum ServerDeploymentType {
enum ServerFeature {
Captcha
Copilot
Indexer
OAuth
Payment
}
@@ -1805,6 +1933,9 @@ type WorkspaceRolePermissions {
}
type WorkspaceType {
"""Search a specific table with aggregate"""
aggregate(input: AggregateInput!): AggregateResultObjectType!
"""List blobs of workspace"""
blobs: [ListedBlob!]!
@@ -1874,6 +2005,9 @@ type WorkspaceType {
"""Role of current signed in user in workspace"""
role: Permission!
"""Search a specific table"""
search(input: SearchInput!): SearchResultObjectType!
"""The team subscription of the workspace, if exists."""
subscription: SubscriptionType