fix failure in mlt with dates, this does mean that currently, mlt, when based on fetching the source and parsing it, does not do mlt on numbers

This commit is contained in:
kimchy 2010-03-30 23:07:59 +03:00
parent 4492293b49
commit 41e100ad33
2 changed files with 6 additions and 1 deletions

View File

@ -151,6 +151,7 @@ public class TransportMoreLikeThisAction extends BaseAction<MoreLikeThisRequest,
boolBuilder.mustNot(termQuery(uidTerm.field(), uidTerm.text()));
} catch (Exception e) {
listener.onFailure(e);
return;
}
String[] searchIndices = request.searchIndices();

View File

@ -141,7 +141,11 @@ public class JsonDateFieldMapper extends JsonNumberFieldMapper<Long> {
}
@Override public String valueAsString(Fieldable field) {
return dateTimeFormatter.printer().print(value(field));
Long value = value(field);
if (value == null) {
return null;
}
return dateTimeFormatter.printer().print(value);
}
@Override public String indexedValue(String value) {