Permalink
Browse files

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)
  • Loading branch information...
reger24 committed Oct 6, 2017
1 parent 5a67d0f commit c31d94664a65ce237459299eb59ecf8c20e40335
@@ -82,7 +82,7 @@ public SolrInputDocument toSolrInputDocument(final SolrDocument doc, Set<String>
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 void add(final SolrInputDocument doc, final SchemaDeclaration key, final
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 SolrInputDocument toSolrInputDocument(SolrDocument doc) {
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;

0 comments on commit c31d946

Please sign in to comment.