Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions src/containers/Tenant/utils/schemaQueryTemplates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -451,12 +451,7 @@ ADD INDEX \${2:my_vector_index}
GLOBAL USING vector_kmeans_tree
ON (\${3:embedding})
WITH (
distance=cosine,
vector_type="uint8",
vector_dimension=\${4:512},
levels=\${5:2},
clusters=\${6:128},
overlap_clusters=\${7:3}
distance=cosine

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve vector-index settings for older clusters

When the UI is used against clusters that do not yet implement the new server-side autodetection, this template now generates an ALTER TABLE ... vector_kmeans_tree statement with only distance, while the docs URL embedded in the template still documents vector_type, vector_dimension, clusters, and levels in every vector-index example. In that environment, selecting “Add vector index” produces SQL that users must know how to repair manually, so please either keep the editable placeholders or gate the simplified form on a backend capability/version check.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot is it real?

);`;
};

Expand Down
4 changes: 2 additions & 2 deletions tests/suites/tenant/queryEditor/queryTemplates.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ test.describe('Query Templates', () => {
expect(editorValue.trim()).toBe(testQuery.trim());
});

test('Add vector index template contains overlap_clusters parameter', async ({page}) => {
test('Add vector index template only contains distance setting', async ({page}) => {
const objectSummary = new ObjectSummary(page);
const queryEditor = new QueryEditor(page);

Expand All @@ -245,7 +245,7 @@ test.describe('Query Templates', () => {
.toContain('vector_kmeans_tree');

const editorContent = await queryEditor.getEditorContent();
expect(editorContent).toContain('overlap_clusters');
expect(editorContent).toContain('distance=cosine');
});

test('Add fulltext index template contains fulltext_relevance and use_filter_snowball', async ({
Expand Down
Loading