Skip to content

Commit db307a0

Browse files
committed
test #644 - add a unit test that validates that patch 484d15c fixes the issue
1 parent 89aa7e7 commit db307a0

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

src/test/java/com/marklogic/client/test/StringSearchTest.java

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,29 @@ public void testJSON()
269269
assertEquals("{", resultsHandle.get().substring(0, 1)); // It's JSON, right?
270270
}
271271

272+
@Test
273+
public void test_issue644() {
274+
QueryManager queryMgr = Common.client.newQueryManager();
275+
String queryText = "queryThatMatchesNothing";
276+
RawCombinedQueryDefinition query = queryMgr.newRawCombinedQueryDefinition(
277+
new StringHandle(
278+
"<search xmlns='http://marklogic.com/appservices/search'>" +
279+
"<options>" +
280+
"<extract-document-data selected='all'>" +
281+
"<extract-path>/*</extract-path>" +
282+
"</extract-document-data>" +
283+
"<return-metrics>true</return-metrics>" +
284+
"</options>" +
285+
"<query>" +
286+
"<term-query><text>" + queryText + "</text></term-query>" +
287+
"</query>" +
288+
"</search>"
289+
)
290+
);
291+
queryMgr.search(query, new SearchHandle());
292+
// we didn't throw an Exception, which means this issue is resolved
293+
}
294+
272295
private String writeOptions()
273296
throws FailedRequestException, ForbiddenUserException, ResourceNotFoundException, ResourceNotResendableException {
274297
String optionsName = "facets";

0 commit comments

Comments
 (0)