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)
pull/135/head
reger 7 years ago
parent 5a67d0f46d
commit c31d94664a

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

Loading…
Cancel
Save