Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

add opensearch rss results to dht collection (due to text = snippet) which is used to differentiate meta from full data - make sure check for dht is not dependant on number of collection entries

reger1481a8ab5610
diff --git a/source/net/yacy/cora/federate/opensearch/OpenSearchConnector.java b/source/net/yacy/cora/federate/opensearch/OpenSearchConnector.java
index c2f8c9e5f..f4a9f9c12 100644
--- a/source/net/yacy/cora/federate/opensearch/OpenSearchConnector.java
+++ b/source/net/yacy/cora/federate/opensearch/OpenSearchConnector.java
@@ -113,10 +113,10 @@ public class OpenSearchConnector extends AbstractFederateSearchConnector impleme
}
doc.setField(CollectionSchema.publisher_t.getSolrFieldName(), item.getCopyright());
- // TODO: we likely got only a search related snippet (take is as text content)
- // we need a way to differentiate metadata from full crawl data in the index (would be also good for rwi transferred/received metadata)
- // or considere to add this to snippet cache, without adding text_t
doc.setField(CollectionSchema.text_t.getSolrFieldName(), item.getDescriptions());
+ // we likely got only a search related snippet (take is as text content)
+ // add collection "dht" which is used to differentiate metadata from full crawl data in the index
+ doc.setField(CollectionSchema.collection_sxt.getSolrFieldName(), "dht");
if (item.getLat() != 0.0 && item.getLon() != 0.0) {
doc.setField(CollectionSchema.coordinate_p.getSolrFieldName(), item.getLat() + "," + item.getLon());
diff --git a/source/net/yacy/search/index/Fulltext.java b/source/net/yacy/search/index/Fulltext.java
index 9f9d8fb38..fd6a9131c 100644
--- a/source/net/yacy/search/index/Fulltext.java
+++ b/source/net/yacy/search/index/Fulltext.java
@@ -352,9 +352,9 @@ public final class Fulltext {
putDocument(getDefaultConfiguration().metadata2solr(entry));
} else {
Collection<Object> collections = doc.getFieldValues(CollectionSchema.collection_sxt.getSolrFieldName());
- for (Object s: collections) {
- if (!"dht".equals(s)) return;
- }
+ // collection dht is used to identify metadata from full crawled documents (if "dht" exists don't overwrite rich crawldata with metadata
+ if (!collections.contains("dht")) return;
+
// passed all checks, overwrite document
putDocument(getDefaultConfiguration().metadata2solr(entry));
}