-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
60b722e
commit f70ca76
Showing
1 changed file
with
4 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,15 @@ | ||
-- Install the extension we just compiled | ||
|
||
CREATE EXTENSION IF NOT EXISTS vector; | ||
CREATE EXTENSION IF NOT EXISTS pg_trgm; | ||
CREATE EXTENSION IF NOT EXISTS fuzzystrmatch; | ||
|
||
/* | ||
For simplicity, we are directly adding the content into this table as | ||
a column containing text data. It could easily be a foreign key pointing to | ||
another table instead that has the content you want to vectorize for | ||
semantic search, just storing here the vectorized content in our "items" table. | ||
"768" dimensions for our vector embedding is critical - that is the | ||
number of dimensions our open source embeddings model output, for later in the | ||
blog post. | ||
*/ | ||
|
||
CREATE TABLE feeds ( | ||
id SERIAL PRIMARY KEY, | ||
title VARCHAR(255) NOT NULL, | ||
link VARCHAR(255) NOT NULL, | ||
link VARCHAR(255) PRIMARY KEY, | ||
language VARCHAR(10), | ||
image_title VARCHAR(255), | ||
image_url VARCHAR(255), | ||
image_width INT, | ||
image_height INT, | ||
summary TEXT, | ||
source VARCHAR(255), | ||
date TIMESTAMP, | ||
embedding vector(768) | ||
date timestamp, | ||
embedding vector(384) | ||
); |