Skip to content

Instantly share code, notes, and snippets.

@zseta
Created October 7, 2025 15:55
Show Gist options
  • Select an option

  • Save zseta/8e8a2e6b3d6fd6572b2110063c9db0de to your computer and use it in GitHub Desktop.

Select an option

Save zseta/8e8a2e6b3d6fd6572b2110063c9db0de to your computer and use it in GitHub Desktop.
CREATE KEYSPACE recommend WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': '3'};
CREATE TABLE recommend.movies (
id INT,
release_date TIMESTAMP,
title TEXT,
tagline TEXT,
genre TEXT,
imdb_id TEXT,
poster_url TEXT,
plot TEXT,
plot_embedding VECTOR<FLOAT, 384>,
PRIMARY KEY (id)
) WITH cdc = {'enabled': 'true'};
CREATE INDEX IF NOT EXISTS ann_index ON recommend.movies(plot_embedding)
USING 'vector_index'
WITH OPTIONS = { 'similarity_function': 'DOT_PRODUCT' };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment