@@ -35,10 +35,12 @@ describe('Testing of the collection.query methods with a simple collection', ()
35
35
{
36
36
name : 'testProp' ,
37
37
dataType : 'text' ,
38
+ vectorizePropertyName : false ,
38
39
} ,
39
40
{
40
41
name : 'testProp2' ,
41
42
dataType : 'text' ,
43
+ vectorizePropertyName : false ,
42
44
} ,
43
45
] ,
44
46
vectorizers : weaviate . configure . vectorizer . text2VecContextionary ( {
@@ -54,8 +56,8 @@ describe('Testing of the collection.query methods with a simple collection', ()
54
56
} ) ;
55
57
return collection . data . insert ( {
56
58
properties : {
57
- testProp : 'test ' ,
58
- testProp2 : 'test2 ' ,
59
+ testProp : 'carrot ' ,
60
+ testProp2 : 'parsnip ' ,
59
61
} ,
60
62
} ) ;
61
63
} ) ;
@@ -65,7 +67,7 @@ describe('Testing of the collection.query methods with a simple collection', ()
65
67
66
68
it ( 'should fetch an object by its id' , async ( ) => {
67
69
const object = await collection . query . fetchObjectById ( id ) ;
68
- expect ( object ?. properties . testProp ) . toEqual ( 'test ' ) ;
70
+ expect ( object ?. properties . testProp ) . toEqual ( 'carrot ' ) ;
69
71
expect ( object ?. uuid ) . toEqual ( id ) ;
70
72
} ) ;
71
73
@@ -87,15 +89,14 @@ describe('Testing of the collection.query methods with a simple collection', ()
87
89
} ) ;
88
90
89
91
it ( 'should query with bm25' , async ( ) => {
90
- const ret = await collection . query . bm25 ( 'test ' ) ;
92
+ const ret = await collection . query . bm25 ( 'carrot ' ) ;
91
93
expect ( ret . objects . length ) . toEqual ( 1 ) ;
92
- expect ( ret . objects [ 0 ] . properties . testProp ) . toEqual ( 'test' ) ;
93
- expect ( ret . objects [ 0 ] . properties . testProp2 ) . toEqual ( 'test2' ) ;
94
+ expect ( ret . objects [ 0 ] . properties . testProp ) . toEqual ( 'carrot' ) ;
94
95
expect ( ret . objects [ 0 ] . uuid ) . toEqual ( id ) ;
95
96
} ) ;
96
97
97
98
it ( 'should query with bm25 and weighted query properties' , async ( ) => {
98
- const ret = await collection . query . bm25 ( 'test ' , {
99
+ const ret = await collection . query . bm25 ( 'carrot ' , {
99
100
queryProperties : [
100
101
{
101
102
name : 'testProp' ,
@@ -105,13 +106,12 @@ describe('Testing of the collection.query methods with a simple collection', ()
105
106
] ,
106
107
} ) ;
107
108
expect ( ret . objects . length ) . toEqual ( 1 ) ;
108
- expect ( ret . objects [ 0 ] . properties . testProp ) . toEqual ( 'test' ) ;
109
- expect ( ret . objects [ 0 ] . properties . testProp2 ) . toEqual ( 'test2' ) ;
109
+ expect ( ret . objects [ 0 ] . properties . testProp ) . toEqual ( 'carrot' ) ;
110
110
expect ( ret . objects [ 0 ] . uuid ) . toEqual ( id ) ;
111
111
} ) ;
112
112
113
113
it ( 'should query with bm25 and weighted query properties with a non-generic collection' , async ( ) => {
114
- const ret = await client . collections . get ( collectionName ) . query . bm25 ( 'test ' , {
114
+ const ret = await client . collections . get ( collectionName ) . query . bm25 ( 'carrot ' , {
115
115
queryProperties : [
116
116
{
117
117
name : 'testProp' ,
@@ -121,33 +121,30 @@ describe('Testing of the collection.query methods with a simple collection', ()
121
121
] ,
122
122
} ) ;
123
123
expect ( ret . objects . length ) . toEqual ( 1 ) ;
124
- expect ( ret . objects [ 0 ] . properties . testProp ) . toEqual ( 'test' ) ;
125
- expect ( ret . objects [ 0 ] . properties . testProp2 ) . toEqual ( 'test2' ) ;
124
+ expect ( ret . objects [ 0 ] . properties . testProp ) . toEqual ( 'carrot' ) ;
126
125
expect ( ret . objects [ 0 ] . uuid ) . toEqual ( id ) ;
127
126
} ) ;
128
127
129
128
it ( 'should query with hybrid' , async ( ) => {
130
- const ret = await collection . query . hybrid ( 'test ' , { limit : 1 } ) ;
129
+ const ret = await collection . query . hybrid ( 'carrot ' , { limit : 1 } ) ;
131
130
expect ( ret . objects . length ) . toEqual ( 1 ) ;
132
- expect ( ret . objects [ 0 ] . properties . testProp ) . toEqual ( 'test' ) ;
133
- expect ( ret . objects [ 0 ] . properties . testProp2 ) . toEqual ( 'test2' ) ;
131
+ expect ( ret . objects [ 0 ] . properties . testProp ) . toEqual ( 'carrot' ) ;
134
132
expect ( ret . objects [ 0 ] . uuid ) . toEqual ( id ) ;
135
133
} ) ;
136
134
137
135
it ( 'should query with hybrid and vector' , async ( ) => {
138
- const ret = await collection . query . hybrid ( 'test ' , {
136
+ const ret = await collection . query . hybrid ( 'carrot ' , {
139
137
limit : 1 ,
140
138
vector : vector ,
141
139
} ) ;
142
140
expect ( ret . objects . length ) . toEqual ( 1 ) ;
143
- expect ( ret . objects [ 0 ] . properties . testProp ) . toEqual ( 'test' ) ;
144
- expect ( ret . objects [ 0 ] . properties . testProp2 ) . toEqual ( 'test2' ) ;
141
+ expect ( ret . objects [ 0 ] . properties . testProp ) . toEqual ( 'carrot' ) ;
145
142
expect ( ret . objects [ 0 ] . uuid ) . toEqual ( id ) ;
146
143
} ) ;
147
144
148
145
it ( 'should query with hybrid and near text subsearch' , async ( ) => {
149
146
const query = ( ) =>
150
- collection . query . hybrid ( 'test ' , {
147
+ collection . query . hybrid ( 'carrot ' , {
151
148
limit : 1 ,
152
149
vector : {
153
150
query : 'apple' ,
@@ -157,7 +154,7 @@ describe('Testing of the collection.query methods with a simple collection', ()
157
154
force : 0.9 ,
158
155
} ,
159
156
moveAway : {
160
- concepts : [ 'test ' ] ,
157
+ concepts : [ 'carrot ' ] ,
161
158
force : 0.1 ,
162
159
} ,
163
160
} ,
@@ -169,12 +166,11 @@ describe('Testing of the collection.query methods with a simple collection', ()
169
166
const ret = await query ( ) ;
170
167
expect ( ret . objects . length ) . toEqual ( 1 ) ;
171
168
expect ( ret . objects [ 0 ] . properties . testProp ) . toEqual ( 'apple' ) ;
172
- expect ( ret . objects [ 0 ] . properties . testProp2 ) . toEqual ( 'banana' ) ;
173
169
} ) ;
174
170
175
171
it ( 'should query with hybrid and near vector subsearch' , async ( ) => {
176
172
const query = ( ) =>
177
- collection . query . hybrid ( 'test ' , {
173
+ collection . query . hybrid ( 'carrot ' , {
178
174
limit : 1 ,
179
175
vector : {
180
176
vector : vector ,
@@ -187,31 +183,27 @@ describe('Testing of the collection.query methods with a simple collection', ()
187
183
}
188
184
const ret = await query ( ) ;
189
185
expect ( ret . objects . length ) . toEqual ( 1 ) ;
190
- expect ( ret . objects [ 0 ] . properties . testProp ) . toEqual ( 'test' ) ;
191
- expect ( ret . objects [ 0 ] . properties . testProp2 ) . toEqual ( 'test2' ) ;
186
+ expect ( ret . objects [ 0 ] . properties . testProp ) . toEqual ( 'carrot' ) ;
192
187
} ) ;
193
188
194
- it . skip ( 'should query with nearObject' , async ( ) => {
189
+ it ( 'should query with nearObject' , async ( ) => {
195
190
const ret = await collection . query . nearObject ( id , { limit : 1 } ) ;
196
191
expect ( ret . objects . length ) . toEqual ( 1 ) ;
197
- expect ( ret . objects [ 0 ] . properties . testProp ) . toEqual ( 'test' ) ;
198
- expect ( ret . objects [ 0 ] . properties . testProp2 ) . toEqual ( 'test2' ) ;
192
+ expect ( ret . objects [ 0 ] . properties . testProp ) . toEqual ( 'carrot' ) ;
199
193
expect ( ret . objects [ 0 ] . uuid ) . toEqual ( id ) ;
200
194
} ) ;
201
195
202
196
it ( 'should query with nearText' , async ( ) => {
203
- const ret = await collection . query . nearText ( [ 'test ' ] , { limit : 1 } ) ;
197
+ const ret = await collection . query . nearText ( [ 'carrot ' ] , { limit : 1 } ) ;
204
198
expect ( ret . objects . length ) . toEqual ( 1 ) ;
205
- expect ( ret . objects [ 0 ] . properties . testProp ) . toEqual ( 'test' ) ;
206
- expect ( ret . objects [ 0 ] . properties . testProp2 ) . toEqual ( 'test2' ) ;
199
+ expect ( ret . objects [ 0 ] . properties . testProp ) . toEqual ( 'carrot' ) ;
207
200
expect ( ret . objects [ 0 ] . uuid ) . toEqual ( id ) ;
208
201
} ) ;
209
202
210
203
it ( 'should query with nearVector' , async ( ) => {
211
204
const ret = await collection . query . nearVector ( vector , { limit : 1 } ) ;
212
205
expect ( ret . objects . length ) . toEqual ( 1 ) ;
213
- expect ( ret . objects [ 0 ] . properties . testProp ) . toEqual ( 'test' ) ;
214
- expect ( ret . objects [ 0 ] . properties . testProp2 ) . toEqual ( 'test2' ) ;
206
+ expect ( ret . objects [ 0 ] . properties . testProp ) . toEqual ( 'carrot' ) ;
215
207
expect ( ret . objects [ 0 ] . uuid ) . toEqual ( id ) ;
216
208
} ) ;
217
209
} ) ;
0 commit comments