@@ -88,8 +88,8 @@ void sidecarWithNamespace() {
8888 doc .assertElementCount ("/ex:sidecar/ex:chunks/ex:chunk" , 4 );
8989 for (XmlNode chunk : doc .getXmlNodes ("/ex:sidecar/ex:chunks/ex:chunk" )) {
9090 chunk .assertElementExists ("/ex:chunk/ex:text" );
91- chunk .assertElementExists ("When a namespace is specified for the sidecar XML document, that should " +
92- "override the default namespace for the embedding element ." , "/ex:chunk/ex :embedding" );
91+ chunk .assertElementExists ("As of 3.0.0, the embedding namespace should be the MarkLogic-specific one, " +
92+ "unless the user explicitly overrides it ." , "/ex:chunk/vec :embedding" );
9393 }
9494 }
9595
@@ -164,8 +164,8 @@ void sidecarWithNoNamespace() {
164164 XmlNode doc = readXmlDocument ("/split-test.xml-chunks-1.xml" );
165165 doc .assertElementValue ("/root/source-uri" , "/split-test.xml" );
166166 doc .assertElementExists ("/root/chunks/chunk[1]/text" );
167- doc .assertElementExists ("Since a namespace is specified for the document - no namespace - it should be " +
168- "applied to the embedding element too ." , "/root/chunks/chunk[1]/embedding" );
167+ doc .assertElementExists ("As of 3.0.0, the embedding element should default to the MarkLogic-specific " +
168+ "namespace unless the user explicitly sets it ." , "/root/chunks/chunk[1]/vec: embedding" );
169169 }
170170
171171 @ Test
@@ -183,7 +183,7 @@ void customChunks() {
183183
184184 XmlNode doc = readXmlDocument ("/split-test.xml" );
185185 doc .assertElementCount ("Each of the 2 custom chunks should have an 'embedding' element." ,
186- "/envelope/my-chunks/my-chunk[my-text and model :embedding]" , 2 );
186+ "/envelope/my-chunks/my-chunk[my-text and vec :embedding]" , 2 );
187187 }
188188
189189 @ Test
@@ -201,8 +201,10 @@ void namespacedCustomChunks() {
201201 .save ();
202202
203203 XmlNode doc = readXmlDocument ("/split-test.xml" );
204- doc .assertElementCount ("Each of the 2 custom chunks should have an 'embedding' element." ,
205- "/ex:envelope/ex:my-chunks/ex:my-chunk[ex:my-text and model:embedding]" , 2 );
204+ doc .assertElementCount ("As of 3.0.0, the embedding element should default to the MarkLogic-specific " +
205+ "namespace unless the user explicitly sets it. In this test, the chunks are in a custom namespace, " +
206+ "but the embedding is not." ,
207+ "/ex:envelope/ex:my-chunks/ex:my-chunk[ex:my-text and vec:embedding]" , 2 );
206208 }
207209
208210 @ Test
@@ -299,8 +301,9 @@ private void verifyEachChunkOnDocumentHasAnEmbedding(String uri) {
299301 doc .getXmlNodes ("/node()/model:chunks/model:chunk" ).forEach (chunk -> {
300302 chunk .assertElementExists ("/model:chunk/model:text" );
301303 chunk .assertElementExists (
302- "As of the 2.7.0 release, the embedding should have the zxx lang to disable stemming by MarkLogic." ,
303- "/model:chunk/model:embedding[@xml:lang='zxx']"
304+ "As of the 2.7.0 release, the embedding should have the zxx lang to disable stemming by MarkLogic. " +
305+ "And as of the 3.0.0 release, the embedding should default to the MarkLogic-specific vector namespace." ,
306+ "/model:chunk/vec:embedding[@xml:lang='zxx']"
304307 );
305308 });
306309 }
@@ -391,12 +394,13 @@ private void verifyDocumentHasTwoChunksWithEncodedVectors(XmlNode doc) {
391394 doc .assertElementCount ("/root/model:chunks/model:chunk" , 2 );
392395
393396 for (XmlNode chunk : doc .getXmlNodes ("/root/model:chunks/model:chunk" )) {
394- String embeddingValue = chunk .getElementValue ("/model:chunk/model:embedding" );
397+ System .out .println (chunk .getPrettyXml ());
398+ String embeddingValue = chunk .getElementValue ("/model:chunk/vec:embedding" );
395399 assertEquals ("AAAAAAMAAADD9UhAH4XLP5qZKUA=" , embeddingValue ,
396400 "Base64 encoded vector should match expected encoding for test vector [3.14, 1.59, 2.65]" );
397401
398402 chunk .assertElementExists ("xml:lang attribute should be 'zxx' to disable stemming" ,
399- "/model:chunk/model :embedding[@xml:lang='zxx']" );
403+ "/model:chunk/vec :embedding[@xml:lang='zxx']" );
400404 }
401405 }
402406}
0 commit comments