Fix test failures when using the `termvectors` endpoint with a type name.

This commit is contained in:
Adrien Grand 2018-12-05 11:28:12 +01:00
parent b9707c29a1
commit 4c2e0d76f3
1 changed files with 3 additions and 1 deletions

View File

@ -102,7 +102,9 @@ public class MultiTermVectorsRequest extends ActionRequest
throw new IllegalArgumentException("docs array element should include an object");
}
TermVectorsRequest termVectorsRequest = new TermVectorsRequest(template);
termVectorsRequest.type(MapperService.SINGLE_MAPPING_NAME);
if (termVectorsRequest.type() == null) {
termVectorsRequest.type(MapperService.SINGLE_MAPPING_NAME);
}
TermVectorsRequest.parseRequest(termVectorsRequest, parser);
add(termVectorsRequest);
}