Skip to content

Commit 2fae24c

Browse files
authored
Merge pull request #1682 from BillFarber/task/createFromSearchDocsTest
Created a test for a new bug.
2 parents f19e65e + fc37446 commit 2fae24c

File tree

1 file changed

+18
-0
lines changed
  • marklogic-client-api/src/test/java/com/marklogic/client/test/rows

1 file changed

+18
-0
lines changed

marklogic-client-api/src/test/java/com/marklogic/client/test/rows/VectorTest.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,4 +108,22 @@ void cosineSimilarity_InvalidVector() {
108108
assertTrue(actualMessage.contains("arg2 is not of type vec:vector"), "Unexpected message: " + actualMessage);
109109
}
110110

111+
@Test
112+
// As of 07/26/24, this test will fail with the ML12 develop branch.
113+
// However, it will succeed with the 12ea1 build.
114+
// See https://progresssoftware.atlassian.net/browse/MLE-15707
115+
void bindVectorFromDocs() {
116+
PlanBuilder.ModifyPlan plan =
117+
op.fromSearchDocs(
118+
op.cts.andQuery(
119+
op.cts.documentQuery("/optic/vectors/alice.json"),
120+
op.cts.elementQuery(
121+
"person",
122+
op.cts.trueQuery()
123+
)
124+
))
125+
.bind(op.as("embedding", op.vec.vector(op.xpath("doc", "/person/embedding"))));
126+
List<RowRecord> rows = resultRows(plan);
127+
assertEquals(1, rows.size());
128+
}
111129
}

0 commit comments

Comments
 (0)