Optimize Solr index.
Hide Source
// Use `var solr = require('solr-client')` in your code
var solr = require('./../lib/solr');
var client = solr.createClient();
// You can use `optimize` with or without options.
var options = {
waitFlush: false ,
waitSearcher: true
};
client.optimize(options,function(err,obj){
if(err){
console.log(err);
}else{
console.log(obj);
}
});
// waitFlush : default is true
// waitSearcher : default is true