waitFlush=true and waitSearcher=true to be inline with the defaults for plain HTTP access
Note: In most cases it is not required to do explicit optimize @throws SolrServerException @throws IOException
8384858687888990919293
} else if (operation.equalsIgnoreCase(SolrConstants.OPERATION_COMMIT)) { serverToUse.commit(); } else if (operation.equalsIgnoreCase(SolrConstants.OPERATION_ROLLBACK)) { serverToUse.rollback(); } else if (operation.equalsIgnoreCase(SolrConstants.OPERATION_OPTIMIZE)) { serverToUse.optimize(); } else { throw new IllegalArgumentException(SolrConstants.OPERATION + " header value '" + operation + "' is not supported"); } }
186187188189190191192193194195196
docs.add(doc); } solr.add(docs); solr.commit(); solr.optimize(); //<start id="solrj-search-1"/> SolrQuery queryParams = new SolrQuery();//<co id="solrj-search.co.query"/> queryParams.setFields("description", "title");//<co id="solrj-search.co.fields"/> queryParams.setQuery("description:win OR description:all");//<co id="solrj-search.co.terms"/> queryParams.setRows(10);
183184185186187188189190191192193
public boolean saveOrUpdateBeans(List<Serializable> indexBeans) { boolean isSuccess = false; try { SolrServer solrServer = this.getSolrClient(); solrServer.addBeans(indexBeans); solrServer.optimize(); solrServer.commit(); logger.info("Add or Update index beans request commit success! " + indexBeans); isSuccess = true; } catch (SolrServerException e) { logger.error(e.toString());
221222223224225226227228229230231
solrInputDocument.addField(key, value); } solrServer.add(solrInputDocument); } solrServer.optimize(); solrServer.commit(); logger.info("Add or Update index request commit success! " + indexDocuments); isSuccess = true; } catch (SolrServerException e) { logger.error(e.toString());
952953954955956957958959960961962
solrServer.commit(); if (count < batchSize) { done = true; } } solrServer.optimize(); } catch (Exception e) { String msg = String.format("Error while updating topics on Solr Core '%s'.", solrCoreId); throw new TrainingSetException(msg, e); } return processedCount;
11501151115211531154115511561157115811591160
for (int cvFoldIndex = 0; cvFoldIndex < cvIterationCount; cvFoldIndex++) { updatedTopics = performCVFold(cvFoldIndex, cvFoldCount, cvIterationCount, incremental); } SolrServer solrServer = getActiveSolrServer(); solrServer.optimize(); } catch (ConfigurationException e) { throw new ClassifierException(e); } catch (IOException e) { throw new ClassifierException(e); } catch (SolrServerException e) {
781782783784785786787788789790791
* @throws YardException on any error while optimising */ public final void optimize() throws YardException{ SolrServer server = getServer(); try { server.optimize(); } catch (SolrServerException e) { throw new YardException("Unable to optimise SolrIndex!", e); } catch (IOException e) { throw new YardException("Unable to optimise SolrIndex!", e); }
8081828384858687888990
728729730731732733734735736737738
841842843844845846847848849850851