double maxScore = Double.POSITIVE_INFINITY;
String secondaryField = "id";
Object secondaryValue = null;
if (bookmark != null) {
String[] bookmarkParts = bookmark.split(",");
if (bookmarkParts.length != 3) throw new ApiException("InvalidBookmark","Bookmark must have three elements, seperated by commas, instead we found: \""+bookmark+"\"");
String maxScoreString = bookmarkParts[0];
if (maxScoreString.length() > 0) {
try {
maxScore = Double.parseDouble(maxScoreString);
} catch(NumberFormatException e) {
throw new ApiException("InvalidBookmark","Uparsable max score in \""+bookmark+"\"");
}
}
secondaryField = bookmarkParts[1];
try {
secondaryValue = Util.jsonDecode(bookmarkParts[2]);
} catch(Util.JsonParseRuntimeException e) {
throw new ApiException("InvalidBookmark", "Invalid compare JSON value in bookmark: "+e.getMessage());
}
}
Object scorePattern = options.get("score");
Iter iter = subService.query(bag, txnId, query, options);
if (scorePattern == null) {