fix for bug 260

pull/1/head
orbiter 12 years ago
parent a9c8046c87
commit 5533fc8e01

@ -125,7 +125,9 @@ public class InstanceMirror {
public EmbeddedSolrConnector getDefaultEmbeddedConnector() { public EmbeddedSolrConnector getDefaultEmbeddedConnector() {
if (this.defaultEmbeddedConnector != null) return this.defaultEmbeddedConnector; if (this.defaultEmbeddedConnector != null) return this.defaultEmbeddedConnector;
this.defaultEmbeddedConnector = this.solr0 == null ? null : new EmbeddedSolrConnector(this.solr0); this.defaultEmbeddedConnector = this.solr0 == null ? null : new EmbeddedSolrConnector(this.solr0);
this.embeddedCache.put(this.getDefaultCoreName(), this.defaultEmbeddedConnector); String coreName = this.getDefaultCoreName();
if (coreName == null) return null;
this.embeddedCache.put(coreName, this.defaultEmbeddedConnector);
return this.defaultEmbeddedConnector; return this.defaultEmbeddedConnector;
} }

@ -23,7 +23,7 @@ import java.io.IOException;
import net.yacy.search.Switchboard; import net.yacy.search.Switchboard;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.concurrent.Semaphore; import java.util.concurrent.Semaphore;
import net.yacy.cora.federate.solr.connector.EmbeddedSolrConnector; import net.yacy.cora.federate.solr.connector.SolrConnector;
import net.yacy.cora.util.ConcurrentLog; import net.yacy.cora.util.ConcurrentLog;
import net.yacy.kelondro.workflow.AbstractBusyThread; import net.yacy.kelondro.workflow.AbstractBusyThread;
import net.yacy.search.schema.CollectionConfiguration; import net.yacy.search.schema.CollectionConfiguration;
@ -46,7 +46,7 @@ import org.apache.solr.common.SolrInputDocument;
*/ */
public class ReindexSolrBusyThread extends AbstractBusyThread { public class ReindexSolrBusyThread extends AbstractBusyThread {
final EmbeddedSolrConnector esc; SolrConnector esc;
final CollectionConfiguration colcfg; // collection config final CollectionConfiguration colcfg; // collection config
int processed = 0; // total number of reindexed documents int processed = 0; // total number of reindexed documents
int docstoreindex = 0; // documents found to reindex for current query int docstoreindex = 0; // documents found to reindex for current query
@ -61,6 +61,7 @@ import org.apache.solr.common.SolrInputDocument;
public ReindexSolrBusyThread(String query) { public ReindexSolrBusyThread(String query) {
super(100,1000,0,500); super(100,1000,0,500);
this.esc = Switchboard.getSwitchboard().index.fulltext().getDefaultEmbeddedConnector(); this.esc = Switchboard.getSwitchboard().index.fulltext().getDefaultEmbeddedConnector();
if (this.esc == null) this.esc = Switchboard.getSwitchboard().index.fulltext().getDefaultRemoteSolrConnector();
this.colcfg = Switchboard.getSwitchboard().index.fulltext().getDefaultConfiguration(); this.colcfg = Switchboard.getSwitchboard().index.fulltext().getDefaultConfiguration();
if (Switchboard.getSwitchboard().getThread("reindexSolr") != null) { if (Switchboard.getSwitchboard().getThread("reindexSolr") != null) {
@ -108,7 +109,6 @@ import org.apache.solr.common.SolrInputDocument;
if (sem.tryAcquire()) { if (sem.tryAcquire()) {
try { try {
String query = querylist.get(0); String query = querylist.get(0);
boolean go = true;
SolrDocumentList xdocs = esc.getDocumentListByQuery(query, start, chunksize); SolrDocumentList xdocs = esc.getDocumentListByQuery(query, start, chunksize);
docstoreindex = (int) xdocs.getNumFound(); docstoreindex = (int) xdocs.getNumFound();

Loading…
Cancel
Save