Skip to content

Commit 42615c2

Browse files
committed
finalise 256 vector params
1 parent b057468 commit 42615c2

File tree

2 files changed

+106
-157
lines changed

2 files changed

+106
-157
lines changed

packages/core/src/semsearch/params.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export const SEQ_SCAN_THRESHOLD = 15000;
1+
export const SEQ_SCAN_THRESHOLD = 25000;
22
export const VECTOR_SIMILARITY_SEARCH_LIMIT = 10000;
33
export const HNSW_EF_SEARCH = 200;
44
export const HNSW_MAX_SCAN_TUPLES = 20000;

packages/scripts/src/collection.ts

Lines changed: 105 additions & 156 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { getDeps } from "@/deps";
66

77
const collections = ["editor", "terminal", "frontend", "languages"];
88

9-
const { db, currStage, closeConnection } = getDeps();
9+
const { db, closeConnection } = getDeps();
1010

1111
try {
1212
for (const collection of collections) {
@@ -46,161 +46,110 @@ try {
4646
if (!terminalCollectionId) {
4747
throw new Error("Terminal collection not found");
4848
}
49-
if (currStage !== "prod") {
50-
const editorRepos = await db
51-
.select()
52-
.from(repos)
53-
.where(
54-
or(
55-
eq(repos.ownerLogin, "coder"),
56-
eq(repos.name, "vscode"),
57-
eq(repos.name, "cursor"),
58-
),
59-
);
60-
await db
61-
.insert(publicCollectionsToRepos)
62-
.values(
63-
editorRepos.map((repo) => ({
64-
collectionId: editorCollectionId.id,
65-
repoId: repo.id,
66-
})),
67-
)
68-
.onConflictDoNothing();
69-
console.log(`Added ${editorRepos.length} repos to editor collection`);
70-
const frontendRepos = await db
71-
.select()
72-
.from(repos)
73-
.where(or(eq(repos.ownerLogin, "vercel"), eq(repos.ownerLogin, "vuejs")));
74-
await db
75-
.insert(publicCollectionsToRepos)
76-
.values(
77-
frontendRepos.map((repo) => ({
78-
collectionId: frontendCollectionId.id,
79-
repoId: repo.id,
80-
})),
81-
)
82-
.onConflictDoNothing();
83-
console.log(`Added ${frontendRepos.length} repos to frontend collection`);
84-
const languagesRepos = await db
85-
.select()
86-
.from(repos)
87-
.where(or(eq(repos.name, "node"), eq(repos.name, "TypeScript")));
88-
await db
89-
.insert(publicCollectionsToRepos)
90-
.values(
91-
languagesRepos.map((repo) => ({
92-
collectionId: languagesCollectionId.id,
93-
repoId: repo.id,
94-
})),
95-
)
96-
.onConflictDoNothing();
97-
console.log(`Added ${languagesRepos.length} repos to languages collection`);
98-
} else {
99-
const terminalRepos = await db
100-
.select()
101-
.from(repos)
102-
.where(
103-
or(
104-
eq(repos.name, "terminal"),
105-
eq(repos.name, "iTerm2"),
106-
eq(repos.name, "ghostty"),
107-
eq(repos.name, "kitty"),
108-
eq(repos.name, "zellij"),
109-
eq(repos.name, "alacritty"),
110-
eq(repos.name, "wezterm"),
111-
eq(repos.name, "xterm.js"),
112-
eq(repos.name, "Warp"),
113-
eq(repos.name, "tabby"),
114-
eq(repos.name, "waveterm"),
115-
),
116-
);
117-
await db
118-
.insert(publicCollectionsToRepos)
119-
.values(
120-
terminalRepos.map((repo) => ({
121-
collectionId: terminalCollectionId.id,
122-
repoId: repo.id,
123-
})),
124-
)
125-
.onConflictDoNothing();
126-
console.log(`Added ${terminalRepos.length} repos to terminal collection`);
127-
const editorRepos = await db
128-
.select()
129-
.from(repos)
130-
.where(
131-
or(
132-
eq(repos.name, "vscode"),
133-
eq(repos.name, "coder"),
134-
eq(repos.name, "emacs"),
135-
eq(repos.name, "vscodium"),
136-
eq(repos.name, "vim"),
137-
eq(repos.name, "helix"),
138-
eq(repos.name, "notepad-plus-plus"),
139-
),
140-
);
141-
await db
142-
.insert(publicCollectionsToRepos)
143-
.values(
144-
editorRepos.map((repo) => ({
145-
collectionId: editorCollectionId.id,
146-
repoId: repo.id,
147-
})),
148-
)
149-
.onConflictDoNothing();
150-
console.log(`Added ${editorRepos.length} repos to editor collection`);
151-
const languagesRepos = await db
152-
.select()
153-
.from(repos)
154-
.where(
155-
or(
156-
eq(repos.name, "TypeScript"),
157-
eq(repos.name, "node"),
158-
eq(repos.name, "rust"),
159-
eq(repos.name, "go"),
160-
eq(repos.name, "swift"),
161-
eq(repos.name, "cpython"),
162-
eq(repos.name, "kotlin"),
163-
eq(repos.name, "php-src"),
164-
eq(repos.name, "ruby"),
165-
eq(repos.name, "elixir"),
166-
),
167-
);
168-
await db
169-
.insert(publicCollectionsToRepos)
170-
.values(
171-
languagesRepos.map((repo) => ({
172-
collectionId: languagesCollectionId.id,
173-
repoId: repo.id,
174-
})),
175-
)
176-
.onConflictDoNothing();
177-
console.log(`Added ${languagesRepos.length} repos to languages collection`);
178-
const frontendRepos = await db
179-
.select()
180-
.from(repos)
181-
.where(
182-
or(
183-
eq(repos.name, "react"),
184-
eq(repos.name, "next.js"),
185-
eq(repos.name, "svelte"),
186-
eq(repos.name, "astro"),
187-
eq(repos.name, "solid"),
188-
eq(repos.name, "angular"),
189-
eq(repos.name, "vue"),
190-
eq(repos.name, "qwik"),
191-
),
192-
);
193-
await db
194-
.insert(publicCollectionsToRepos)
195-
.values(
196-
frontendRepos.map((repo) => ({
197-
collectionId: frontendCollectionId.id,
198-
repoId: repo.id,
199-
})),
200-
)
201-
.onConflictDoNothing();
202-
console.log(`Added ${frontendRepos.length} repos to frontend collection`);
203-
}
49+
const terminalRepos = await db
50+
.select()
51+
.from(repos)
52+
.where(
53+
or(
54+
eq(repos.name, "terminal"),
55+
eq(repos.name, "iTerm2"),
56+
eq(repos.name, "ghostty"),
57+
eq(repos.name, "kitty"),
58+
eq(repos.name, "zellij"),
59+
eq(repos.name, "alacritty"),
60+
eq(repos.name, "wezterm"),
61+
eq(repos.name, "xterm.js"),
62+
eq(repos.name, "Warp"),
63+
eq(repos.name, "tabby"),
64+
eq(repos.name, "waveterm"),
65+
),
66+
);
67+
await db
68+
.insert(publicCollectionsToRepos)
69+
.values(
70+
terminalRepos.map((repo) => ({
71+
collectionId: terminalCollectionId.id,
72+
repoId: repo.id,
73+
})),
74+
)
75+
.onConflictDoNothing();
76+
console.log(`Added ${terminalRepos.length} repos to terminal collection`);
77+
const editorRepos = await db
78+
.select()
79+
.from(repos)
80+
.where(
81+
or(
82+
eq(repos.name, "vscode"),
83+
eq(repos.name, "coder"),
84+
eq(repos.name, "emacs"),
85+
eq(repos.name, "vscodium"),
86+
eq(repos.name, "vim"),
87+
eq(repos.name, "helix"),
88+
eq(repos.name, "notepad-plus-plus"),
89+
),
90+
);
91+
await db
92+
.insert(publicCollectionsToRepos)
93+
.values(
94+
editorRepos.map((repo) => ({
95+
collectionId: editorCollectionId.id,
96+
repoId: repo.id,
97+
})),
98+
)
99+
.onConflictDoNothing();
100+
console.log(`Added ${editorRepos.length} repos to editor collection`);
101+
const languagesRepos = await db
102+
.select()
103+
.from(repos)
104+
.where(
105+
or(
106+
eq(repos.name, "TypeScript"),
107+
eq(repos.name, "node"),
108+
eq(repos.name, "rust"),
109+
eq(repos.name, "go"),
110+
eq(repos.name, "swift"),
111+
eq(repos.name, "cpython"),
112+
eq(repos.name, "kotlin"),
113+
eq(repos.name, "php-src"),
114+
eq(repos.name, "ruby"),
115+
eq(repos.name, "elixir"),
116+
),
117+
);
118+
await db
119+
.insert(publicCollectionsToRepos)
120+
.values(
121+
languagesRepos.map((repo) => ({
122+
collectionId: languagesCollectionId.id,
123+
repoId: repo.id,
124+
})),
125+
)
126+
.onConflictDoNothing();
127+
console.log(`Added ${languagesRepos.length} repos to languages collection`);
128+
const frontendRepos = await db
129+
.select()
130+
.from(repos)
131+
.where(
132+
or(
133+
eq(repos.name, "react"),
134+
eq(repos.name, "next.js"),
135+
eq(repos.name, "svelte"),
136+
eq(repos.name, "astro"),
137+
eq(repos.name, "solid"),
138+
eq(repos.name, "angular"),
139+
eq(repos.name, "vue"),
140+
eq(repos.name, "qwik"),
141+
),
142+
);
143+
await db
144+
.insert(publicCollectionsToRepos)
145+
.values(
146+
frontendRepos.map((repo) => ({
147+
collectionId: frontendCollectionId.id,
148+
repoId: repo.id,
149+
})),
150+
)
151+
.onConflictDoNothing();
152+
console.log(`Added ${frontendRepos.length} repos to frontend collection`);
204153
} catch (e) {
205154
console.error(e);
206155
} finally {

0 commit comments

Comments
 (0)