provide more information if a null DocumentMapper is returned

This commit is contained in:
Simon Willnauer 2013-01-18 16:10:49 +01:00
parent c563248f76
commit 31fd521fd1
1 changed files with 4 additions and 1 deletions

View File

@ -136,7 +136,10 @@ public class TransportMoreLikeThisAction extends TransportAction<MoreLikeThisReq
}
final BoolQueryBuilder boolBuilder = boolQuery();
try {
DocumentMapper docMapper = indicesService.indexServiceSafe(concreteIndex).mapperService().documentMapper(request.type());
final DocumentMapper docMapper = indicesService.indexServiceSafe(concreteIndex).mapperService().documentMapper(request.type());
if (docMapper == null) {
throw new ElasticSearchException("No DocumentMapper found for type [" + request.type() + "]");
}
final Set<String> fields = newHashSet();
if (request.fields() != null) {
for (String field : request.fields()) {