if (qs.startsWith("values")) {
rsp.add("testname1","testval1");
rsp.add("testarr1",new String[]{"my val 1","my val 2"});
NamedList nl = new NamedList();
nl.add("myInt", 333);
nl.add("myNullVal", null);
nl.add("myFloat",1.414213562f);
nl.add("myDouble", 1e100d);
nl.add("myBool", false);
nl.add("myLong",999999999999L);
Document doc = new Document();
doc.add(new Field("id","55",Field.Store.YES, Field.Index.NOT_ANALYZED));
nl.add("myDoc",doc);
nl.add("myResult",results);
nl.add("myStr","&wow! test escaping: a&b<c&");
nl.add(null, "this value had a null name...");
nl.add("myIntArray", new Integer[] { 100, 5, -10, 42 });
nl.add("epoch", new Date(0));
nl.add("currDate", new Date(System.currentTimeMillis()));
rsp.add("myNamedList", nl);
} else if (qs.startsWith("fields")) {
NamedList nl = new NamedList();
Collection flst;
flst = searcher.getReader().getFieldNames(IndexReader.FieldOption.INDEXED);
nl.add("indexed",flst);
flst = searcher.getReader().getFieldNames(IndexReader.FieldOption.UNINDEXED);
nl.add("unindexed",flst);
rsp.add("fields", nl);
}
test(results.size() <= limit);
test(results.size() <= results.matches());