ghosty
ghosty•4mo ago

VectorIndex not on v module

Hey, just started using convex: it's great! One issue I'm having is that I don't see the .vectorIndex method existing on defineTable({...}). I only see .index and .searchIndex. Is there something separate I must do?
36 Replies
Convex Bot
Convex Bot•4mo ago
Thanks for posting in <#1088161997662724167>. Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets. - Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.) - Use search.convex.dev to search Docs, Stack, and Discord all at once. - Additionally, you can post your questions in the Convex Community's <#1228095053885476985> channel to receive a response from AI. - Avoid tagging staff unless specifically instructed. Thank you!
jamalsoueidan
jamalsoueidan•4mo ago
Can we see how you define your schema, because I just tested it locally, and I have searchIndex,index,validator,and vectorIndex
ghosty
ghostyOP•4mo ago
No description
ghosty
ghostyOP•4mo ago
No validator or vector index; just index and searchIndex
jamalsoueidan
jamalsoueidan•4mo ago
export const Documents= Table("documents", {
...
});
export const Documents= Table("documents", {
...
});
export default defineSchema({
documents: Documents.table.vectorIndex(),
})
export default defineSchema({
documents: Documents.table.vectorIndex(),
})
ghosty
ghostyOP•4mo ago
Hm... I don't have a "Table" constructor
jamalsoueidan
jamalsoueidan•4mo ago
import { Table } from "convex-helpers/server";
//OR
import { defineSchema, defineTable } from "convex/server";
export default defineSchema({
documents: defineTable({
...
}).vectorIndex,
});
//OR
import { defineSchema, defineTable } from "convex/server";
export default defineSchema({
documents: defineTable({
...
}).vectorIndex,
});
ghosty
ghostyOP•4mo ago
Hmm no luck so far
ghosty
ghostyOP•4mo ago
No description
jamalsoueidan
jamalsoueidan•4mo ago
import { defineSchema} from "convex/server"; export default defineSchema({ documents: defineTable({ ... }).vectorIndex, });
ghosty
ghostyOP•4mo ago
^using the latest convex if that helps
jamalsoueidan
jamalsoueidan•4mo ago
Thats wierd... import { defineSchema } from "convex/server"; remove the defineTable
ghosty
ghostyOP•4mo ago
hmm
jamalsoueidan
jamalsoueidan•4mo ago
my mistake 🙂
ghosty
ghostyOP•4mo ago
oh no no thank you still not saying found strange
jamalsoueidan
jamalsoueidan•4mo ago
what you see, i dont see, so you must show me the code, and tell me thats strange 😄 thats not enough and your schema?
ghosty
ghostyOP•4mo ago
in separate files but import { defineSchema } from "convex/server"; import { DocumentsSchemaMetadataTable, DocumentsTable } from "./DocumentSchema"; // Define the full schema with tables. export default defineSchema({ documents: DocumentsTable, documentsSchemaMetadata: DocumentsSchemaMetadataTable, });
jamalsoueidan
jamalsoueidan•4mo ago
thats strange 😄 what typescript version are you using?
ghosty
ghostyOP•4mo ago
lemme see "typescript": "^5.6.2" "@types/node": "^22.7.1", "@types/react": "^17.0.0", "@types/uuid": "^10.0.0", "@typescript-eslint/eslint-plugin": "^6.5.0", "@typescript-eslint/parser": "^6.5.0",
jamalsoueidan
jamalsoueidan•4mo ago
im not sure if its related to that,,, im running 5.1.6
ghosty
ghostyOP•4mo ago
hmm let me try
jamalsoueidan
jamalsoueidan•4mo ago
"convex": "^1.16.0", "convex-helpers": "^0.1.57",
ghosty
ghostyOP•4mo ago
"convex": "^1.16.3", "convex-helpers": "^0.1.58", ok not typescript
jamalsoueidan
jamalsoueidan•4mo ago
try to downgrade your convex just to test
ghosty
ghostyOP•4mo ago
ok didnt work, still views defineSchema as in convex/schema
jamalsoueidan
jamalsoueidan•4mo ago
what is packages? is that your project folder?
ghosty
ghostyOP•4mo ago
"dependencies": { "convex": "1.16.0", "convex-helpers": "^0.1.58", "next": "^12.0.0", "react": "^17.0.0", "react-dom": "^17.0.0", "ts-node": "^10.9.2", "uuid": "^10.0.0", "zod": "^3.23.8" }, "devDependencies": { "@types/node": "^22.7.1", "@types/react": "^17.0.0", "@types/uuid": "^10.0.0", "@typescript-eslint/eslint-plugin": "^6.5.0", "@typescript-eslint/parser": "^6.5.0", "eslint": "^8.0.0", "eslint-config-next": "^12.0.0", "jest": "^29.6.4", "lerna": "^7.4.2", "ts-jest": "^29.1.1", "typescript": "^5.6.2" }
jamalsoueidan
jamalsoueidan•4mo ago
how did you create the project?
ghosty
ghostyOP•4mo ago
{ "functions": "./packages/convex" } then the normal deploy
jamalsoueidan
jamalsoueidan•4mo ago
you need to pick from these quickstarts which one did oyu use?
ghosty
ghostyOP•4mo ago
this is the one i used
jamalsoueidan
jamalsoueidan•4mo ago
try new proejct from start npx create-next-app@latest my-app cd my-app && npm install convex
ghosty
ghostyOP•4mo ago
weird.. its working when i do that.. hmm somehow fixed it. not sure what did it exactly, but i tried the installation pipeline again with npm instead of yarn now it works, maybe it was a build file?
jamalsoueidan
jamalsoueidan•4mo ago
I could be many things, but I dont know what it could be 🙂

Did you find this page helpful?