I want to retrieve all docs from a particular collection in novus via a system test in the WLNSearch app. This collection currently only has 51 docs. I run the query via easel (PROD-F) on my collection (w_an_napa) with the query "=n-document" and see these 51 docs. I want to mimic this same behavior and be able to loop through all the docs. This is my first stab at coding this, but it's stuck in what seems to be an infinite loop (at the "sleeping" output). Any ideas what I'm doing wrong? Or can anyone point me to a similar working example?
Thanks,
Ben
public class ProduceOutputTest extends SpringSystemTestCase
{
@Autowired private ApplicationContext applicationContext;
@Test public void queryNovus() {
try
{
CobaltNovus novus = (CobaltNovus) this.applicationContext.getBean("novus");
Search search = novus.fetchSearch();
search.setQueryType(Search.BOOLEAN);
search.setQueryText("=n-document");
search.addCollection("w_an_napa");
Progress p = search.submit(true);
while (!p.isComplete())
{
LOG.debug("sleeping");
Thread.currentThread().sleep(1000);
}
DocumentGuid[] guids = search.getDocumentGuids();
LOG.debug("guids.length: "+guids.length);
}
catch (Throwable t)
{
LOG.error("", t);
}
}