Skip to content

Commit a1e573a

Browse files
chore(search): remove legacy indexed enterprise search (#8528)
* chore(search): remove legacy indexed enterprise search * fix(search): preserve live onboarding and Slack scope policies * fix(search): close retired document writes and refresh Search consent * fix(search): preserve ordinary knowledge base classification
1 parent 9a2b64d commit a1e573a

276 files changed

Lines changed: 2147 additions & 23554 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/ci.yml‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,6 @@ jobs:
222222
platforms: linux/amd64
223223
tags: ${{ steps.login-ecr.outputs.registry }}/${{ steps.ecr-repo.outputs.name }}:${{ github.sha }}-dev
224224
build-args: |
225-
SIM_SEARCH_LIVE_DEFAULT=true
226225
MSHIP_PLAN_MODE_DEFAULT=true
227226
max-cache-size-mb: ${{ matrix.cache_mb }}
228227

‎.github/workflows/desktop-e2e.yml‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ on:
2828
- 'apps/sim/hooks/queries/personal-search-integrations.ts'
2929
- 'apps/sim/hooks/use-search-integration-connection.ts'
3030
- 'apps/sim/hooks/use-github-installation-setup.ts'
31-
- 'apps/sim/app/o/**/integrations/indexed/use-member-enrollment.ts'
3231
- 'apps/sim/lib/api/contracts/desktop-source-connect.ts'
3332
- 'apps/sim/scripts/fixtures/desktop-source-connect.tsx'
3433
- 'apps/sim/app/workspace/**/browser-session/**'

‎apps/docs/content/docs/platform/self-hosting/integrations-oauth.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ The private key must include its PEM header, footer, and contents. Sim accepts a
207207

208208
Keep the private key and client secret in the deployment's server configuration; organization admins select installations in Sim without entering these secrets.
209209

210-
The live Search application needs these five variables. If a worker also indexes ordinary GitHub knowledge bases, or Search has explicitly reverted to `SIM_SEARCH_LIVE=false`, configure the variables in that worker’s matching environment too. Updating the app’s secret store does not update a separately configured worker. Live Search does not schedule a GitHub indexing worker.
210+
The live Search application needs these five variables. If a worker also indexes ordinary GitHub knowledge bases, configure the variables in that worker’s matching environment too. Updating the app’s secret store does not update a separately configured worker. Live Search does not schedule a GitHub indexing worker.
211211

212212
The **Client ID** is different from the numeric **App ID**. Use credentials from **Developer settings → GitHub Apps**. `GITHUB_CLIENT_ID` and `GITHUB_CLIENT_SECRET` belong to the separate GitHub sign-in integration and remain unchanged. Search does not read `GITHUB_REPO_CLIENT_ID` or `GITHUB_REPO_CLIENT_SECRET`.
213213

‎apps/docs/content/docs/search/index.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,6 @@ Conversations remain private to their author. Connecting an external account doe
8080

8181
## Legacy indexing and workspace knowledge bases
8282

83-
Live Search is the default. An operator can explicitly set `SIM_SEARCH_LIVE=false` to restore the legacy indexed Search backend. Its content sync, document processing, and stored permission maintenance are specific to that mode. These guides describe live Search.
83+
Enterprise Search uses live provider queries. Search sources do not run content indexing or stored permission maintenance; ordinary knowledge-base connectors retain their indexing behavior.
8484

8585
Ordinary workspace [knowledge bases](/knowledgebase) still ingest, chunk, and index documents for their own features. Their connector setup, processing status, and access settings remain separate.

‎apps/docs/content/docs/search/mcp.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ The connection applies to the organization whose URL you copied. Sim checks curr
4444

4545
`chat` accepts questions up to 8,192 characters. Tool responses are limited to 1 MiB. API rate limits apply; follow any retry delay. Provider failures or incomplete retrieval are reported explicitly, and the tools do not fall back to an old index when a live provider is unavailable.
4646

47-
These are the live-backend schemas. If an operator explicitly selects legacy Search with `SIM_SEARCH_LIVE=false`, the server advertises its indexed search/read schemas instead. Refresh your MCP client's tool discovery after changing backends.
47+
These are the Search MCP schemas. Refresh tool discovery in clients that previously connected to the retired indexed backend.
4848

4949
## Reconnect or revoke access
5050

‎apps/sim/app/api/knowledge/connectors/directory-sync/route.test.ts‎

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import {
44
hasMockCondition,
55
resetEnvFlagsMock,
66
schemaMock,
7-
setEnvFlags,
87
} from '@sim/testing'
98
import { authInternalMock, authInternalMockFns } from '@sim/testing/mocks/auth-internal.mock'
109
import { dbChainMockFns } from '@sim/testing/mocks/database.mock'
@@ -108,24 +107,6 @@ describe('connector directory sync scheduler', () => {
108107
await expect(run()).resolves.toMatchObject({ dispatched: 1, failed: 1 })
109108
})
110109

111-
it.each([true, false])(
112-
'excludes Search directories from scheduled pages only when live Search is %s',
113-
async (liveSearch) => {
114-
setEnvFlags({ isLiveEnterpriseSearchEnabled: liveSearch })
115-
mockConnectorRows.mockResolvedValue([])
116-
await run()
117-
expect(
118-
hasMockCondition(
119-
mockWhere.mock.calls[0][0],
120-
(node) =>
121-
node.type === 'eq' &&
122-
node.left === schemaMock.knowledgeBase.isSearchIndex &&
123-
node.right === false
124-
)
125-
).toBe(liveSearch)
126-
}
127-
)
128-
129110
it('does not enqueue a connector another scheduler claimed or paused', async () => {
130111
mockConnectorRows.mockResolvedValue([connector()])
131112
mockClaim.mockResolvedValueOnce([])

‎apps/sim/app/api/knowledge/search/route.ts‎

Lines changed: 1 addition & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -6,68 +6,9 @@ import {
66
} from '@/lib/api/server/routes'
77
import { internalKnowledgeErrorPolicies } from '@/lib/knowledge/api/route-policies'
88
import { knowledgeOperations } from '@/lib/knowledge/application/operations'
9-
import { DEFAULT_RERANKER_MODEL } from '@/lib/knowledge/reranker-models'
10-
import { sourceAuthor } from '@/lib/knowledge/search/author'
11-
import { searchScopedKnowledge } from '@/lib/sim-search/indexed'
12-
import { isIndexedOrgSearchEnabled } from '@/lib/sim-search/indexed/gate'
139
import { searchLiveKnowledge } from '@/lib/sim-search/live/application'
1410

15-
const DIRECT_SEARCH_VECTOR_BUDGET_MS = 3000
16-
17-
const indexedSearchRoute = defineInternalJsonRoute({
18-
contract: searchWorkspaceKnowledgeContract,
19-
auth: internalSessionAuth,
20-
operation: knowledgeOperations.search,
21-
rateLimit: internalRateLimits.none({
22-
reason:
23-
'A person typing queries; the embedding call is metered against the canonical search owner',
24-
}),
25-
errorPolicy: internalKnowledgeErrorPolicies.search,
26-
mapInput: ({ body }, { request }) => ({
27-
workspaceId: body.workspaceId,
28-
organizationId: body.organizationId,
29-
filters: body.filters,
30-
query: body.query,
31-
topK: body.topK,
32-
allowPartialResults: true,
33-
vectorBudgetMs: DIRECT_SEARCH_VECTOR_BUDGET_MS,
34-
/**
35-
* A person's search is reranked by a cross-encoder whenever the workspace or the platform
36-
* holds a key for one; the use case checks that before spending a call, and reranking stays
37-
* best-effort, so a provider outage leaves the fused order in place.
38-
*/
39-
rerankerEnabled: true,
40-
rerankerModel: DEFAULT_RERANKER_MODEL,
41-
surface: 'dashboard' as const,
42-
signal: request.signal,
43-
}),
44-
useCase: searchScopedKnowledge,
45-
present: ({ results, knowledgeBases, retrieval }, { input }) => {
46-
const knowledgeBaseNames = new Map(knowledgeBases.map((kb) => [kb.id, kb.name]))
47-
return {
48-
success: true as const,
49-
data: {
50-
query: input.query ?? '',
51-
retrieval,
52-
results: results.map((result) => ({
53-
documentId: result.documentId,
54-
knowledgeBaseId: result.knowledgeBaseId,
55-
knowledgeBaseName: knowledgeBaseNames.get(result.knowledgeBaseId) ?? '',
56-
documentName: result.documentName,
57-
sourceUrl: result.sourceUrl,
58-
connectorType: result.connectorType,
59-
sourceModifiedAt: result.sourceModifiedAt?.toISOString() ?? null,
60-
author: sourceAuthor(result.metadata),
61-
content: result.content,
62-
chunkIndex: result.chunkIndex,
63-
similarity: result.similarity,
64-
})),
65-
},
66-
}
67-
},
68-
})
69-
70-
const liveSearchRoute = defineInternalJsonRoute({
11+
export const POST = defineInternalJsonRoute({
7112
contract: searchWorkspaceKnowledgeContract,
7213
auth: internalSessionAuth,
7314
operation: knowledgeOperations.search,
@@ -80,6 +21,3 @@ const liveSearchRoute = defineInternalJsonRoute({
8021
useCase: searchLiveKnowledge,
8122
present: (data) => ({ success: true as const, data }),
8223
})
83-
84-
/** Indexed organization search is dormant unless its gate is on; Live Search serves otherwise. */
85-
export const POST = isIndexedOrgSearchEnabled() ? indexedSearchRoute : liveSearchRoute

‎apps/sim/app/api/knowledge/sim-search/connect/route.ts‎

Lines changed: 0 additions & 20 deletions
This file was deleted.

‎apps/sim/app/api/knowledge/sim-search/integrations/overview/route.ts‎

Lines changed: 0 additions & 23 deletions
This file was deleted.

‎apps/sim/app/api/knowledge/sim-search/personal-source-setup/route.ts‎

Lines changed: 0 additions & 70 deletions
This file was deleted.

0 commit comments

Comments
 (0)