/** * A {@link FieldSearchQuery} may be made from a terms string or a query * string, but not both. */ private FieldSearchQuery assembleFieldSearchQuery(String query, String terms) { if (terms != null) { return new FieldSearchQuery(terms); } else { try { return new FieldSearchQuery(Condition.getConditions(query)); } catch (QueryParseException e) { throw new ValidatorProcessUsageException("Value '" + query + "' of parameter '" + PARAMETER_QUERY + "' is not a valid query string."); } } }
maxResults, new FieldSearchQuery(Condition .getConditions(query)));
maxResults, new FieldSearchQuery(Condition .getConditions(query)));
1, new FieldSearchQuery(Condition .getConditions("pid='" + pid + "' dcmDate>'2000-01-01'"))) 1, new FieldSearchQuery(Condition .getConditions("pid='" + pid + "'"))) .objectFieldsList();
result = m_access.findObjects(context, wantedFields, maxResults, new FieldSearchQuery(terms)); } else { result = m_access.findObjects(context, wantedFields, maxResults, new FieldSearchQuery(Condition.getConditions(query)));
result = m_access.findObjects(context, wantedFields, maxResults, new FieldSearchQuery(terms)); } else { result = m_access.findObjects(context, wantedFields, maxResults, new FieldSearchQuery(Condition.getConditions(query)));
1, new FieldSearchQuery(Condition .getConditions("pid='" + pid + "' dcmDate>'2000-01-01'"))) 1, new FieldSearchQuery(Condition .getConditions("pid='" + pid + "'"))) .objectFieldsList();
100, new FieldSearchQuery(Condition .getConditions("pid='" + pid + "' dcmDate>'2000-01-01'"))) 1, new FieldSearchQuery(Condition .getConditions("pid='" + pid + "'"))) .objectFieldsList();
100, new FieldSearchQuery(Condition .getConditions("pid='" + pid + "' dcmDate>'2000-01-01'"))) 1, new FieldSearchQuery(Condition .getConditions("pid='" + pid + "'"))) .objectFieldsList();
(int) getMaxHeaders(), new FieldSearchQuery(Condition .getConditions("dcmDate>'2000-01-01'" + getDatePart(from, until))));
(int) getMaxRecords(), new FieldSearchQuery(Condition .getConditions("dcmDate>'2000-01-01'" + getDatePart(from, until))));
(int) getMaxHeaders(), new FieldSearchQuery(Condition .getConditions("dcmDate>'2000-01-01'" + getDatePart(from, until))));
(int) getMaxRecords(), new FieldSearchQuery(Condition .getConditions("dcmDate>'2000-01-01'" + getDatePart(from, until))));
@Test public void testIndexAndFindByDCIdentifier() throws Exception { init(maxResultsDefault, maxSecondsPerSessionDefault, true); // add one object with DC to index String pid1 = "test:1"; DigitalObject obj1 = getTestObject(pid1, pid1); String dcContent = "<dc:identifier>" + pid1 + "</dc:identifier>"; addXDatastream(obj1, "DC", getDC(dcContent)); setDates(obj1, new Date()); m_repo.putObject(obj1); DOReader reader1 = m_repo.getReader(false, null, pid1); m_impl.update(reader1); // query for it via dc:identifier FieldSearchQuery query = new FieldSearchQuery(Condition.getConditions("identifier~" + pid1)); int[] expected = new int[] { 1, 1 }; // first try with client requesting max TEN results per page // should get 1 page w/1 result checkResults(expected, countResults(query, 10)); // then try same, but with client requesting max ONE result per page // should still get 1 page w/1 result checkResults(expected, countResults(query, 1)); }