1
- // This is because of the long vec value in the data
2
- /* eslint-disable max-len */
3
1
import React , { useState , useMemo , useEffect } from 'react'
4
2
5
3
import { Title } from 'uiSrc/components/base/text'
@@ -25,64 +23,18 @@ import NoDataMessage from '../components/no-data-message/NoDataMessage'
25
23
import { QueryCard } from './QueryCard'
26
24
import { IndexSelect } from './IndexSelect'
27
25
import { NoDataMessageKeys } from '../components/no-data-message/data'
26
+ import { savedQueries } from './saved-queries'
28
27
29
28
const mockSavedIndexes : SavedIndex [ ] = [
30
29
{
31
30
value : PresetDataType . BIKES ,
32
31
tags : [ FieldTypes . TAG , FieldTypes . TEXT , FieldTypes . VECTOR ] ,
33
- queries : [
34
- {
35
- label : 'Search for "Nord" bikes ordered by price' ,
36
- value : 'FT.SEARCH idx:bikes_vss "@brand:Nord" SORTBY price ASC' ,
37
- } ,
38
- {
39
- label : 'Find road alloy bikes under 20kg' ,
40
- value : 'FT.SEARCH idx:bikes_vss "@material:{alloy} @weight:[0 20]"' ,
41
- } ,
42
- ] ,
32
+ queries : savedQueries [ PresetDataType . BIKES ] ,
43
33
} ,
44
34
{
45
35
value : PresetDataType . MOVIES ,
46
36
tags : [ FieldTypes . TAG , FieldTypes . TEXT , FieldTypes . VECTOR ] ,
47
- queries : [
48
- {
49
- label : 'I want a fun animated movie about toys and friendship' ,
50
- value :
51
- 'FT.SEARCH idx:movies_vss "*=>[KNN 3 @embedding $vec AS score]" ' +
52
- `PARAMS 2 vec ${ String . raw `"\x9a\x99\x19\x3f\xcd\xcc\xcc\x3d\x9a\x99\x4c\x3f\x9a\x99\x33\x3e\x9a\x99\x33\x3f\xcd\xcc\x66\x3e\xcd\xcc\xcc\x3d\xcd\xcc\x4c\x3e"` } ` +
53
- 'SORTBY score ' +
54
- 'RETURN 3 title plot score ' +
55
- 'DIALECT 2' ,
56
- } ,
57
- {
58
- label : 'A feel-good film about music and students' ,
59
- value :
60
- 'FT.SEARCH idx:movies_vss "@genres:{Music} =>[KNN 5 @embedding $vec AS score]" ' +
61
- `PARAMS 2 vec ${ String . raw `"\x9a\x99\x1d\x3e\xcd\xcc\x4c\xbd\x9a\x99\x99\x3e\x9a\x99\x19\x3e\x9a\x99\x19\xbe\x9a\x99\x1d\x3e\xcd\xcc\x0c\x3e\x9a\x99\xf1\xbc"` } ` +
62
- 'SORTBY score ' +
63
- 'RETURN 3 title genres score ' +
64
- 'DIALECT 2' ,
65
- } ,
66
- {
67
- label : 'Find classic musical rebellion films from the 90s' ,
68
- value :
69
- 'FT.SEARCH idx:movies_vss "(@genres:{Music} @year:[1970 1979]) =>[KNN 5 @embedding $vec AS score]" ' +
70
- `PARAMS 2 vec ${ String . raw `"\x9a\x99\x1d\x3e\xcd\xcc\x4c\xbd\x9a\x99\x99\x3e\x9a\x99\x19\x3e\x9a\x99\x19\xbe\x9a\x99\x1d\x3e\xcd\xcc\x0c\x3e\x9a\x99\xf1\xbc"` } ` +
71
- 'SORTBY score ' +
72
- 'RETURN 4 title year genres score ' +
73
- 'DIALECT 2' ,
74
- } ,
75
- {
76
- label :
77
- 'You like Animated and Sci-Fi movies. Personalize results by filtering the vector search' ,
78
- value :
79
- `FT.SEARCH idx:movies_vss '@genres:{"Animated"|"Sci-Fi"} =>[KNN 5 @embedding $vec AS score]' ` +
80
- `PARAMS 2 vec ${ String . raw `"\x9a\x99\x1d\x3e\xcd\xcc\x4c\xbd\x9a\x99\x99\x3e\x9a\x99\x19\x3e\x9a\x99\x19\xbe\x9a\x99\x1d\x3e\xcd\xcc\x0c\x3e\x9a\x99\xf1\xbc"` } ` +
81
- 'SORTBY score ' +
82
- 'RETURN 3 title genres score ' +
83
- 'DIALECT 2' ,
84
- } ,
85
- ] ,
37
+ queries : savedQueries [ PresetDataType . MOVIES ] ,
86
38
} ,
87
39
]
88
40
0 commit comments