Add ResultSet#sort
[yaz4j-moved-to-github.git] / src / main / java / org / yaz4j / ResultSet.java
index 766b998..aef52f6 100644 (file)
@@ -104,6 +104,12 @@ public class ResultSet implements Iterable<Record> {
     };
   }
 
+  public ResultSet sort(String type, String spec) throws ZoomException {
+    int ret = yaz4jlib.ZOOM_resultset_sort1(resultSet, type, spec);
+    if (ret != 0) throw new ZoomException("Sorting resultset failed");
+    return this;
+  }
+
   public long getHitCount() {
     return size;
   }