本文整理汇总了Java中org.apache.solr.client.solrj.SolrServer.deleteByQuery方法的典型用法代码示例。如果您正苦于以下问题:Java SolrServer.deleteByQuery方法的具体用法?Java SolrServer.deleteByQuery怎么用?Java SolrServer.deleteByQuery使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.solr.client.solrj.SolrServer
的用法示例。
在下文中一共展示了SolrServer.deleteByQuery方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: purgeSolr
import org.apache.solr.client.solrj.SolrServer; //导入方法依赖的package包/类
/**
* Manually purge the index to try again.
* Since this cascade is currently ordered, can be used to purge before we load.
*
* @param opts
* @throws Exception
*/
@SuppressWarnings("deprecation")
@CLIMethod("--solr-purge")
public void purgeSolr(Opts opts) throws Exception {
// Check to see if the global url has been set.
String url = sortOutSolrURL(globalSolrURL);
// Wipe out the solr index at url.
SolrServer server = new CommonsHttpSolrServer(url);
server.deleteByQuery("*:*");
server.commit();
// Probably worked, so let's destroy the log if there is one.
if( globalSolrLogFile != null && globalSolrLogFile.exists() ){
boolean yes_p = globalSolrLogFile.delete();
if( yes_p ){
LOG.info("Deleted GOlr load log file.");
}else{
// Nothing there, doing nothing.
}
}
LOG.info("Purged: " + url);
}
示例2: deleteAllDocuments
import org.apache.solr.client.solrj.SolrServer; //导入方法依赖的package包/类
private void deleteAllDocuments() throws SolrServerException, IOException {
SolrServer s = solrServer;
s.deleteByQuery("*:*"); // delete everything!
s.commit();
}
示例3: resetSolrIndex
import org.apache.solr.client.solrj.SolrServer; //导入方法依赖的package包/类
public static void resetSolrIndex(SolrServer solr) throws SolrServerException, IOException {
solr.deleteByQuery("*:*");
solr.commit();
}
示例4: clearDB
import org.apache.solr.client.solrj.SolrServer; //导入方法依赖的package包/类
public static void clearDB(String solrURL, String solrCore) throws SolrServerException, IOException {
SolrServer server = SolrHandler.createConnection(solrURL, solrCore);
System.out.println("RESET:");
server.deleteByQuery("*:*");
server.commit();
}
示例5: resetSolrIndex
import org.apache.solr.client.solrj.SolrServer; //导入方法依赖的package包/类
public void resetSolrIndex() throws SolrServerException, IOException {
SolrServer solr = bookeryService.getSolrConnection();
solr.deleteByQuery("*:*");
solr.commit();
}
示例6: del
import org.apache.solr.client.solrj.SolrServer; //导入方法依赖的package包/类
protected void del(String q) throws Exception {
controlClient.deleteByQuery(q);
for (SolrServer client : clients) {
client.deleteByQuery(q);
}
}
示例7: deleteAllDocuments
import org.apache.solr.client.solrj.SolrServer; //导入方法依赖的package包/类
private void deleteAllDocuments() throws SolrServerException, IOException {
collector.reset();
SolrServer s = solrServer;
s.deleteByQuery("*:*"); // delete everything!
s.commit();
}