try {
con.connect();
ResultSet set = con.search(query, Connection.QueryType.PrefixQuery);
- response.getWriter().println("Showing " + maxrecs + " of " +set.getSize());
+ response.getWriter().println("Showing " + maxrecs + " of " +set.getHitCount());
response.getWriter().println();
- for(int i=0; i<set.getSize() && i<maxrecs; i++) {
+ for(int i=0; i<set.getHitCount() && i<maxrecs; i++) {
Record rec = set.getRecord(i);
+ if (rec == null) continue;
response.getWriter().print(rec.render());
}
} catch (ZoomException ze) {
ResultSet s = con.search("@attr 1=4 utah", Connection.QueryType.PrefixQuery);
System.out.println("Search for 'utah'...");
assertNotNull(s);
- assertEquals(s.getSize(), 9);
+ assertEquals(s.getHitCount(), 9);
Record rec = s.getRecord(0);
assertNotNull(rec);
byte[] content = rec.getContent();
con.connect();
System.out.println("Search for something that exists...");
ResultSet set = con.search("@attr 1=7 0253333490", Connection.QueryType.PrefixQuery);
- System.out.println("Result set size: " + set.getSize());
+ System.out.println("Result set size: " + set.getHitCount());
System.out.println("Get the first record...");
Record rec = set.getRecord(0);
if (rec == null) {
con.connect();
ResultSet s = con.search("100", Connection.QueryType.PrefixQuery);
assertNotNull(s);
- assertEquals(s.getSize(), 100);
+ assertEquals(s.getHitCount(), 100);
Record rec = s.getRecord(0);
fail("We should never get here and get ZoomeException instead");
} catch (ZoomException ze) {