@@ -35,10 +35,12 @@ describe('Testing of the collection.query methods with a simple collection', ()
3535 {
3636 name : 'testProp' ,
3737 dataType : 'text' ,
38+ vectorizePropertyName : false ,
3839 } ,
3940 {
4041 name : 'testProp2' ,
4142 dataType : 'text' ,
43+ vectorizePropertyName : false ,
4244 } ,
4345 ] ,
4446 vectorizers : weaviate . configure . vectorizer . text2VecContextionary ( {
@@ -54,8 +56,8 @@ describe('Testing of the collection.query methods with a simple collection', ()
5456 } ) ;
5557 return collection . data . insert ( {
5658 properties : {
57- testProp : 'test ' ,
58- testProp2 : 'test2 ' ,
59+ testProp : 'carrot ' ,
60+ testProp2 : 'parsnip ' ,
5961 } ,
6062 } ) ;
6163 } ) ;
@@ -65,7 +67,7 @@ describe('Testing of the collection.query methods with a simple collection', ()
6567
6668 it ( 'should fetch an object by its id' , async ( ) => {
6769 const object = await collection . query . fetchObjectById ( id ) ;
68- expect ( object ?. properties . testProp ) . toEqual ( 'test ' ) ;
70+ expect ( object ?. properties . testProp ) . toEqual ( 'carrot ' ) ;
6971 expect ( object ?. uuid ) . toEqual ( id ) ;
7072 } ) ;
7173
@@ -87,15 +89,14 @@ describe('Testing of the collection.query methods with a simple collection', ()
8789 } ) ;
8890
8991 it ( 'should query with bm25' , async ( ) => {
90- const ret = await collection . query . bm25 ( 'test ' ) ;
92+ const ret = await collection . query . bm25 ( 'carrot ' ) ;
9193 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' ) ;
9495 expect ( ret . objects [ 0 ] . uuid ) . toEqual ( id ) ;
9596 } ) ;
9697
9798 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 ' , {
99100 queryProperties : [
100101 {
101102 name : 'testProp' ,
@@ -105,13 +106,12 @@ describe('Testing of the collection.query methods with a simple collection', ()
105106 ] ,
106107 } ) ;
107108 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' ) ;
110110 expect ( ret . objects [ 0 ] . uuid ) . toEqual ( id ) ;
111111 } ) ;
112112
113113 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 ' , {
115115 queryProperties : [
116116 {
117117 name : 'testProp' ,
@@ -121,33 +121,30 @@ describe('Testing of the collection.query methods with a simple collection', ()
121121 ] ,
122122 } ) ;
123123 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' ) ;
126125 expect ( ret . objects [ 0 ] . uuid ) . toEqual ( id ) ;
127126 } ) ;
128127
129128 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 } ) ;
131130 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' ) ;
134132 expect ( ret . objects [ 0 ] . uuid ) . toEqual ( id ) ;
135133 } ) ;
136134
137135 it ( 'should query with hybrid and vector' , async ( ) => {
138- const ret = await collection . query . hybrid ( 'test ' , {
136+ const ret = await collection . query . hybrid ( 'carrot ' , {
139137 limit : 1 ,
140138 vector : vector ,
141139 } ) ;
142140 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' ) ;
145142 expect ( ret . objects [ 0 ] . uuid ) . toEqual ( id ) ;
146143 } ) ;
147144
148145 it ( 'should query with hybrid and near text subsearch' , async ( ) => {
149146 const query = ( ) =>
150- collection . query . hybrid ( 'test ' , {
147+ collection . query . hybrid ( 'carrot ' , {
151148 limit : 1 ,
152149 vector : {
153150 query : 'apple' ,
@@ -157,7 +154,7 @@ describe('Testing of the collection.query methods with a simple collection', ()
157154 force : 0.9 ,
158155 } ,
159156 moveAway : {
160- concepts : [ 'test ' ] ,
157+ concepts : [ 'carrot ' ] ,
161158 force : 0.1 ,
162159 } ,
163160 } ,
@@ -169,12 +166,11 @@ describe('Testing of the collection.query methods with a simple collection', ()
169166 const ret = await query ( ) ;
170167 expect ( ret . objects . length ) . toEqual ( 1 ) ;
171168 expect ( ret . objects [ 0 ] . properties . testProp ) . toEqual ( 'apple' ) ;
172- expect ( ret . objects [ 0 ] . properties . testProp2 ) . toEqual ( 'banana' ) ;
173169 } ) ;
174170
175171 it ( 'should query with hybrid and near vector subsearch' , async ( ) => {
176172 const query = ( ) =>
177- collection . query . hybrid ( 'test ' , {
173+ collection . query . hybrid ( 'carrot ' , {
178174 limit : 1 ,
179175 vector : {
180176 vector : vector ,
@@ -187,31 +183,27 @@ describe('Testing of the collection.query methods with a simple collection', ()
187183 }
188184 const ret = await query ( ) ;
189185 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' ) ;
192187 } ) ;
193188
194- it . skip ( 'should query with nearObject' , async ( ) => {
189+ it ( 'should query with nearObject' , async ( ) => {
195190 const ret = await collection . query . nearObject ( id , { limit : 1 } ) ;
196191 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' ) ;
199193 expect ( ret . objects [ 0 ] . uuid ) . toEqual ( id ) ;
200194 } ) ;
201195
202196 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 } ) ;
204198 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' ) ;
207200 expect ( ret . objects [ 0 ] . uuid ) . toEqual ( id ) ;
208201 } ) ;
209202
210203 it ( 'should query with nearVector' , async ( ) => {
211204 const ret = await collection . query . nearVector ( vector , { limit : 1 } ) ;
212205 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' ) ;
215207 expect ( ret . objects [ 0 ] . uuid ) . toEqual ( id ) ;
216208 } ) ;
217209} ) ;
0 commit comments