r 8364 changes to exclude check on betamap

This commit is contained in:
anupsawant 2011-06-30 12:10:16 +00:00
parent 14bba181c2
commit 5f3ee8aa07

View file

@ -177,7 +177,6 @@ public class SolrIndexer implements IndexerIface {
} }
} }
@Override @Override
public synchronized void endIndexing() { public synchronized void endIndexing() {
try { try {
@ -187,22 +186,12 @@ public class SolrIndexer implements IndexerIface {
log.error("Could not commit to solr server", e); log.error("Could not commit to solr server", e);
} catch(IOException e){ } catch(IOException e){
log.error("Could not commit to solr server", e); log.error("Could not commit to solr server", e);
}finally{
if(!individualToSolrDoc.documentModifiers.isEmpty()){
if(individualToSolrDoc.documentModifiers.get(0) instanceof CalculateParameters){
CalculateParameters c = (CalculateParameters) individualToSolrDoc.documentModifiers.get(0);
c.clearMap();
log.info("BetaMap cleared");
} }
}
}
try { try {
server.optimize(); server.optimize();
} catch (Exception e) { } catch (Exception e) {
log.error("Could not optimize solr server", e); log.error("Could not optimize solr server", e);
} }
indexing = false; indexing = false;
notifyAll(); notifyAll();
} }
@ -230,8 +219,23 @@ public class SolrIndexer implements IndexerIface {
} }
public boolean isIndexEmpty() { public boolean isIndexEmpty() {
// TODO Auto-generated method stub SolrQuery query = new SolrQuery();
query.setQuery("*:*");
try {
QueryResponse rsp = server.query(query);
SolrDocumentList docs = rsp.getResults();
if(docs==null || docs.size()==0){
return true;
}
} catch (SolrServerException e) {
// TODO Auto-generated catch block
log.error(e,e);
}
return false; return false;
} }
} }