mirror of
https://github.com/yacy/yacy_search_server.git
synced 2025-07-19 08:44:42 -04:00
do not apply lazy value instantiation for numeric or boolean values
because that is misleading and confusing in case of 0- or false-values and may cause NPEs in retrieval functions.
This commit is contained in:
@ -257,17 +257,17 @@ public class SchemaConfiguration extends Configuration implements Serializable {
|
||||
|
||||
public void add(final SolrInputDocument doc, final SchemaDeclaration key, final int value) {
|
||||
assert !key.isMultiValued() : "key = " + key.getSolrFieldName();
|
||||
if ((isEmpty() || contains(key)) && (!this.lazy || value != 0)) key.add(doc, value);
|
||||
if (isEmpty() || contains(key)) key.add(doc, value);
|
||||
}
|
||||
|
||||
public void add(final SolrInputDocument doc, final SchemaDeclaration key, final long value) {
|
||||
assert !key.isMultiValued() : "key = " + key.getSolrFieldName();
|
||||
if ((isEmpty() || contains(key)) && (!this.lazy || value != 0)) key.add(doc, value);
|
||||
if (isEmpty() || contains(key)) key.add(doc, value);
|
||||
}
|
||||
|
||||
public void add(final SolrInputDocument doc, final SchemaDeclaration key, final boolean value) {
|
||||
assert !key.isMultiValued() : "key = " + key.getSolrFieldName();
|
||||
if ((isEmpty() || contains(key)) && (!this.lazy || value)) key.add(doc, value);
|
||||
if (isEmpty() || contains(key)) key.add(doc, value);
|
||||
}
|
||||
|
||||
public static Date getDate(SolrInputDocument doc, final SchemaDeclaration key) {
|
||||
|
Reference in New Issue
Block a user