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
pull/8/head
reger 10 years ago
parent 5f4d35437e
commit 1481a8ab56

@ -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());

@ -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));
}

Loading…
Cancel
Save