added solr highlighting / YaCy snippets to YaCy search results
- facets are now much more complete
- facets are computed and searched much faster
- snippet computation is done by solr if solr knows the snippet
sb.index.fulltext().getSolr().deleteByQuery(YaCySchema.host_id_s.name()+":\""+hosthash+"\" AND "+YaCySchema.failreason_t.name()+":[* TO *]");
sb.index.fulltext().getSolr().deleteByQuery(YaCySchema.host_id_s.getSolrFieldName()+":\""+hosthash+"\" AND "+YaCySchema.failreason_t.getSolrFieldName()+":[* TO *]");
ReversibleScoreMap<String>errorscore=admin?fulltext.getSolr().getFacets(YaCySchema.failreason_t.name()+":[* TO *]",newString[]{YaCySchema.host_s.name()},maxcount).get(YaCySchema.host_s.name()):null;
ReversibleScoreMap<String>errorscore=admin?fulltext.getSolr().getFacets(YaCySchema.failreason_t.getSolrFieldName()+":[* TO *]",newString[]{YaCySchema.host_s.getSolrFieldName()},maxcount).get(YaCySchema.host_s.getSolrFieldName()):null;
privatedoublekmNormal=100.d;// 100 =ca 40000.d / 360.d == 111.11 - if lat/lon is multiplied with this, rounded and diveded by this, the location is normalized to a 1km grid
@ -506,22 +520,30 @@ public final class QueryParams {
protectedfinalHandleSeturlhashes;// map for double-check; String/Long relation, addresses ranking number (backreference for deletion)
protectedfinalScoreMap<String>hostNavigator;// a counter for the appearance of the host hash
protectedfinalMap<String,byte[]>hostResolver;// a mapping from a host hash (6 bytes) to the full url hash of one of these urls that have the host hash
protectedfinalScoreMap<String>hostNavigator=newConcurrentScoreMap<String>();// a counter for the appearance of host names
protectedfinalScoreMap<String>hostHashNavigator;// a counter for the appearance of the host hash (this can be filled during classic remote search)
protectedfinalMap<String,byte[]>hostHashResolver;// a mapping from a host hash (6 bytes) to the full url hash of one of these urls that have the host hash
protectedfinalMap<String,String>taggingPredicates;// a map from tagging vocabulary names to tagging predicate uris
protectedfinalMap<String,ScoreMap<String>>vocabularyNavigator;// counters for Vocabularies; key is metatag.getVocabularyName()
privatebooleanremote;
@ -117,8 +118,8 @@ public final class RankingProcess extends Thread {
@ -246,16 +239,16 @@ public class SnippetWorker extends Thread {
if(!snippet.getErrorCode().fail()){
// we loaded the file and found the snippet
returnnewResultEntry(page,this.snippetProcess.query.getSegment(),this.snippetProcess.peers,snippet,null,dbRetrievalTime,snippetComputationTime);// result with snippet attached
returnnewResultEntry(page,this.snippetProcess.query.getSegment(),this.snippetProcess.peers,snippet,null, snippetComputationTime);// result with snippet attached
}elseif(cacheStrategy.mustBeOffline()){
// we did not demand online loading, therefore a failure does not mean that the missing snippet causes a rejection of this result
// this may happen during a remote search, because snippet loading is omitted to retrieve results faster
returnnewResultEntry(page,this.snippetProcess.query.getSegment(),this.snippetProcess.peers,null,null,dbRetrievalTime,snippetComputationTime);// result without snippet
returnnewResultEntry(page,this.snippetProcess.query.getSegment(),this.snippetProcess.peers,null,null, snippetComputationTime);// result without snippet