|
|
@ -1032,18 +1032,17 @@ public final class Protocol
|
|
|
|
}
|
|
|
|
}
|
|
|
|
event.rankingProcess.addExpectedRemoteReferences(count);
|
|
|
|
event.rankingProcess.addExpectedRemoteReferences(count);
|
|
|
|
SolrDocumentList docList = null;
|
|
|
|
SolrDocumentList docList = null;
|
|
|
|
final String solrQuerystring = event.getQuery().solrQueryString(false);
|
|
|
|
final String solrQuerystring = event.getQuery().solrQueryString();
|
|
|
|
Log.logInfo("Protocol", "SOLR QUERY: " + solrQuerystring);
|
|
|
|
|
|
|
|
boolean localsearch = target == null || target.equals(event.peers.mySeed());
|
|
|
|
boolean localsearch = target == null || target.equals(event.peers.mySeed());
|
|
|
|
if (localsearch) {
|
|
|
|
if (localsearch) {
|
|
|
|
// search the local index
|
|
|
|
// search the local index
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
docList = event.rankingProcess.getQuery().getSegment().fulltext().getSolr().query(solrQuerystring, offset, count);
|
|
|
|
docList = event.rankingProcess.getQuery().getSegment().fulltext().getSolr().query(solrQuerystring, offset, count);
|
|
|
|
} catch (SolrException e) {
|
|
|
|
} catch (SolrException e) {
|
|
|
|
Network.log.logInfo("SEARCH failed (solr), localpeer (" + e.getMessage() + ")");
|
|
|
|
Network.log.logInfo("SEARCH failed (solr, 1), localpeer (" + e.getMessage() + ")", e);
|
|
|
|
return -1;
|
|
|
|
return -1;
|
|
|
|
} catch (IOException e) {
|
|
|
|
} catch (IOException e) {
|
|
|
|
Network.log.logInfo("SEARCH failed (solr), localpeer (" + e.getMessage() + ")");
|
|
|
|
Network.log.logInfo("SEARCH failed (solr, 2), localpeer (" + e.getMessage() + ")", e);
|
|
|
|
return -1;
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
@ -1053,13 +1052,14 @@ public final class Protocol
|
|
|
|
docList = solrConnector.query(solrQuerystring, offset, count);
|
|
|
|
docList = solrConnector.query(solrQuerystring, offset, count);
|
|
|
|
// no need to close this here because that sends a commit to remote solr which is not wanted here
|
|
|
|
// no need to close this here because that sends a commit to remote solr which is not wanted here
|
|
|
|
} catch (IOException e) {
|
|
|
|
} catch (IOException e) {
|
|
|
|
Network.log.logInfo("SEARCH failed (solr), Peer: " + target.hash + ":" + target.getName() + " (" + e.getMessage() + ")");
|
|
|
|
Network.log.logInfo("SEARCH failed (solr), Peer: " + target.hash + ":" + target.getName() + " (" + e.getMessage() + ")", e);
|
|
|
|
return -1;
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// evaluate result
|
|
|
|
// evaluate result
|
|
|
|
if (docList.size() > 0) {// create containers
|
|
|
|
if (docList.size() > 0) {// create containers
|
|
|
|
|
|
|
|
Network.log.logInfo("SEARCH (solr), returned " + docList.size() + " documents from peer " + target.hash + ":" + target.getName());
|
|
|
|
final List<ReferenceContainer<WordReference>> container = new ArrayList<ReferenceContainer<WordReference>>(wordhashes.size());
|
|
|
|
final List<ReferenceContainer<WordReference>> container = new ArrayList<ReferenceContainer<WordReference>>(wordhashes.size());
|
|
|
|
for (byte[] hash: wordhashes) {
|
|
|
|
for (byte[] hash: wordhashes) {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|