本文整理汇总了Java中org.apache.solr.client.solrj.impl.ConcurrentUpdateSolrServer.request方法的典型用法代码示例。如果您正苦于以下问题:Java ConcurrentUpdateSolrServer.request方法的具体用法?Java ConcurrentUpdateSolrServer.request怎么用?Java ConcurrentUpdateSolrServer.request使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.solr.client.solrj.impl.ConcurrentUpdateSolrServer
的用法示例。
在下文中一共展示了ConcurrentUpdateSolrServer.request方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testWaitOptions
import org.apache.solr.client.solrj.impl.ConcurrentUpdateSolrServer; //导入方法依赖的package包/类
public void testWaitOptions() throws Exception {
// SOLR-3903
final List<Throwable> failures = new ArrayList<>();
ConcurrentUpdateSolrServer s = new ConcurrentUpdateSolrServer
(jetty.getBaseUrl().toString() + "/collection1", 2, 2) {
@Override
public void handleError(Throwable ex) {
failures.add(ex);
}
};
int docId = 42;
for (UpdateRequest.ACTION action : EnumSet.allOf(UpdateRequest.ACTION.class)) {
for (boolean waitSearch : Arrays.asList(true, false)) {
for (boolean waitFlush : Arrays.asList(true, false)) {
UpdateRequest updateRequest = new UpdateRequest();
SolrInputDocument document = new SolrInputDocument();
document.addField("id", docId++ );
updateRequest.add(document);
updateRequest.setAction(action, waitSearch, waitFlush);
s.request(updateRequest);
}
}
}
s.commit();
s.blockUntilFinished();
s.shutdown();
if (0 != failures.size()) {
assertEquals(failures.size() + " Unexpected Exception, starting with...",
null, failures.get(0));
}
}
示例2: testWaitOptions
import org.apache.solr.client.solrj.impl.ConcurrentUpdateSolrServer; //导入方法依赖的package包/类
public void testWaitOptions() throws Exception {
// SOLR-3903
final List<Throwable> failures = new ArrayList<Throwable>();
ConcurrentUpdateSolrServer s = new ConcurrentUpdateSolrServer
(jetty.getBaseUrl().toString(), 2, 2) {
@Override
public void handleError(Throwable ex) {
failures.add(ex);
}
};
int docId = 42;
for (UpdateRequest.ACTION action : EnumSet.allOf(UpdateRequest.ACTION.class)) {
for (boolean waitSearch : Arrays.asList(true, false)) {
for (boolean waitFlush : Arrays.asList(true, false)) {
UpdateRequest updateRequest = new UpdateRequest();
SolrInputDocument document = new SolrInputDocument();
document.addField("id", docId++ );
updateRequest.add(document);
updateRequest.setAction(action, waitSearch, waitFlush);
s.request(updateRequest);
}
}
}
s.commit();
s.blockUntilFinished();
s.shutdown();
if (0 != failures.size()) {
assertEquals(failures.size() + " Unexpected Exception, starting with...",
null, failures.get(0));
}
}