-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create Weaviate schema #49
Conversation
Update staging branch with latest commits to Main
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
"indexSearchable": true, | ||
"name": "userId", | ||
"tokenization": "word" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having the schema available like this is much nicer
indexFilterable: true, | ||
indexSearchable: true, | ||
name: 'userId', | ||
tokenization: 'word' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having the schema available like this is much nicer
@@ -0,0 +1,113 @@ | |||
export const schema = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed this to a static import for the benefits of TS (eg. can access typeof schema.properties[0].name
)
|
||
try { | ||
await client.schema.classCreator().withClass(schema).do() | ||
console.log('Schema created!') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested, super fast. And clean code!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Summary: This is a cleaner way of creating a Weaviate schema (class) without needing to upsert documents. Additionally, this also helps anyone to inspect the contents of the schema to better understand it!