// query and compare results
ILuceneClient client = new LuceneClient(_miniCluster.getZkConfiguration());
Sort sort = new Sort(new SortField[] { new SortField("timesort", SortField.LONG) });
// query both documents
Query query = new QueryParser(Version.LUCENE_30, "", new KeywordAnalyzer()).parse("text:ab*");
Hits hits = client.search(query, new String[] { indexName }, 20, sort);
assertEquals(2, hits.size());
// query only one document
query = new QueryParser(Version.LUCENE_30, "", new KeywordAnalyzer()).parse("text:abc2");
hits = client.search(query, new String[] { indexName }, 20, sort);
assertEquals(1, hits.size());
// query only one document on one node
_miniCluster.shutdownNode(0);
TestUtil.waitUntilIndexBalanced(_protocol, indexName);
query = new QueryParser(Version.LUCENE_30, "", new KeywordAnalyzer()).parse("text:abc2");
hits = client.search(query, new String[] { indexName }, 20, sort);
assertEquals(1, hits.size());
client.close();
}