Skip to content

Commit cbcce53

Browse files
authored
RI-7548,RI-7499: Vector search polishment (#4991)
* add missing tags * sort tags * fix movies index command indentation
1 parent 44c67a3 commit cbcce53

File tree

3 files changed

+36
-20
lines changed

3 files changed

+36
-20
lines changed

redisinsight/ui/src/pages/vector-search/saved-queries/SavedQueriesScreen.tsx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,22 @@ import { savedQueries } from './saved-queries'
2828
const mockSavedIndexes: SavedIndex[] = [
2929
{
3030
value: PresetDataType.BIKES,
31-
tags: [FieldTypes.TAG, FieldTypes.TEXT, FieldTypes.VECTOR],
31+
tags: [
32+
FieldTypes.NUMERIC,
33+
FieldTypes.TAG,
34+
FieldTypes.TEXT,
35+
FieldTypes.VECTOR,
36+
],
3237
queries: savedQueries[PresetDataType.BIKES],
3338
},
3439
{
3540
value: PresetDataType.MOVIES,
36-
tags: [FieldTypes.TAG, FieldTypes.TEXT, FieldTypes.VECTOR],
41+
tags: [
42+
FieldTypes.NUMERIC,
43+
FieldTypes.TAG,
44+
FieldTypes.TEXT,
45+
FieldTypes.VECTOR,
46+
],
3747
queries: savedQueries[PresetDataType.MOVIES],
3848
},
3949
]

redisinsight/ui/src/utils/index/generateFtCreateCommand.spec.ts

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,17 @@ describe('generateFtCreateCommand', () => {
3232
dataContent: SampleDataContent.CONTENT_RECOMMENDATIONS,
3333
})
3434

35-
expect(result).toBe(`FT.CREATE idx:movies ON JSON PREFIX 1 "movie:" SCHEMA
36-
$.title AS title TEXT
37-
$.genres[*] AS genres TAG
38-
$.plot AS plot TEXT
39-
$.year AS year NUMERIC
40-
$.embedding AS embedding VECTOR FLAT 6
41-
TYPE FLOAT32
42-
DIM 8
43-
DISTANCE_METRIC COSINE`)
35+
expect(result).toBe(`FT.CREATE idx:movies
36+
ON JSON
37+
PREFIX 1 "movie:"
38+
SCHEMA
39+
$.title AS title TEXT
40+
$.genres[*] AS genres TAG
41+
$.plot AS plot TEXT
42+
$.year AS year NUMERIC
43+
$.embedding AS embedding VECTOR FLAT 6
44+
TYPE FLOAT32
45+
DIM 8
46+
DISTANCE_METRIC COSINE`)
4447
})
4548
})

redisinsight/ui/src/utils/index/generateFtCreateCommand.ts

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,18 @@ export const generateFtCreateCommand = ({
1515
dataContent,
1616
}: FtCreateCommandParams): string => {
1717
if (dataContent === SampleDataContent.CONTENT_RECOMMENDATIONS) {
18-
return `FT.CREATE ${indexName} ON JSON PREFIX 1 "movie:" SCHEMA
19-
$.title AS title TEXT
20-
$.genres[*] AS genres TAG
21-
$.plot AS plot TEXT
22-
$.year AS year NUMERIC
23-
$.embedding AS embedding VECTOR FLAT 6
24-
TYPE FLOAT32
25-
DIM 8
26-
DISTANCE_METRIC COSINE`
18+
return `FT.CREATE ${indexName}
19+
ON JSON
20+
PREFIX 1 "movie:"
21+
SCHEMA
22+
$.title AS title TEXT
23+
$.genres[*] AS genres TAG
24+
$.plot AS plot TEXT
25+
$.year AS year NUMERIC
26+
$.embedding AS embedding VECTOR FLAT 6
27+
TYPE FLOAT32
28+
DIM 8
29+
DISTANCE_METRIC COSINE`
2730
}
2831

2932
return `FT.CREATE ${indexName}

0 commit comments

Comments
 (0)