|
34 | 34 | import com.fasterxml.jackson.databind.ObjectMapper; |
35 | 35 | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
36 | 36 | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| 37 | +import com.marklogic.client.DatabaseClient; |
37 | 38 | import com.marklogic.client.ResourceNotFoundException; |
| 39 | +import com.marklogic.client.admin.QueryOptionsManager; |
38 | 40 | import com.marklogic.client.impl.PojoRepositoryImpl; |
| 41 | +import com.marklogic.client.io.Format; |
| 42 | +import com.marklogic.client.io.StringHandle; |
39 | 43 | import com.marklogic.client.pojo.PojoPage; |
40 | 44 | import com.marklogic.client.pojo.PojoQueryBuilder; |
41 | 45 | import com.marklogic.client.pojo.PojoQueryBuilder.Operator; |
@@ -284,8 +288,11 @@ public void testC_QueryPojos() throws Exception { |
284 | 288 | assertEquals("Failed to find number of records expected", 1, numRead); |
285 | 289 | assertEquals("PojoPage failed to report number of records expected", numRead, page.size()); |
286 | 290 |
|
287 | | - // - then let's show the old work-around using stored options which contain |
288 | | - // <search-option>filtered</search-option> |
| 291 | + // - then let's show the old work-around using stored options |
| 292 | + QueryOptionsManager queryOptionsMgr = |
| 293 | + Common.newAdminClient().newServerConfigManager().newQueryOptionsManager(); |
| 294 | + queryOptionsMgr.writeOptions("filtered", |
| 295 | + new StringHandle("{\"options\":{\"search-option\":\"filtered\"}}").withFormat(Format.JSON)); |
289 | 296 | StructuredQueryBuilder sqb = Common.client.newQueryManager().newStructuredQueryBuilder("filtered"); |
290 | 297 | query = sqb.and(qb.word("asciiName", new String[] {"wildcarded"}, 1, "Chittagong*")); |
291 | 298 | page = cities.search(query, 1); |
|
0 commit comments