Update deprecated SolrInputDocument.addField() with boost value

remove unused SchemaConfiguration.getDate (as it is designed to return
only past dates which might be unexpected for general configuration schema)
This commit is contained in:
reger committed 2017-10-06 20:32:28 +02:00
1 parent 5a67d0f46d
commit c31d94664a
2 files changed
+2 -8

No files matched your search

@@ -82,7 +82,7 @@ public class SchemaConfiguration extends Configuration implements Serializable {
SolrInputDocument sid = new SolrInputDocument();
for (String name: doc.getFieldNames()) {
if (this.contains(name) && (omitFields == null || !omitFields.contains(name))) { // check each field if enabled in local Solr schema
sid.addField(name, doc.getFieldValue(name), 1.0f);
sid.addField(name, doc.getFieldValue(name));
}
}
return sid;
@@ -165,10 +165,4 @@ public class SchemaConfiguration extends Configuration implements Serializable {
if (isEmpty() || contains(key)) key.add(doc, value);
}
public static Date getDate(SolrInputDocument doc, final SchemaDeclaration key) {
Date x = (Date) doc.getFieldValue(key.getSolrFieldName());
Date now = new Date();
return (x == null) ? new Date(0) : x.after(now) ? now : x;
}
}
@@ -331,7 +331,7 @@ public class WebgraphConfiguration extends SchemaConfiguration implements Serial
SolrInputDocument sid = new SolrInputDocument();
for (String name: doc.getFieldNames()) {
if (this.contains(name)) { // check each field if enabled in local Solr schema
sid.addField(name, doc.getFieldValue(name), 1.0f);
sid.addField(name, doc.getFieldValue(name));
}
}
return sid;