|
@@ -643,24 +643,24 @@ public abstract class MapperTestCase extends MapperServiceTestCase {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ protected boolean supportsStoredFields() {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ protected void minimalStoreMapping(XContentBuilder b) throws IOException {
|
|
|
+ minimalMapping(b);
|
|
|
+ b.field("store", true);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* Checks that loading stored fields for this field produces the same set of values
|
|
|
* for query time scripts and index time scripts
|
|
|
*/
|
|
|
public final void testIndexTimeStoredFieldsAccess() throws IOException {
|
|
|
|
|
|
- MapperService mapperService;
|
|
|
- try {
|
|
|
- mapperService = createMapperService(fieldMapping(b -> {
|
|
|
- minimalMapping(b);
|
|
|
- b.field("store", true);
|
|
|
- }));
|
|
|
- assertParseMinimalWarnings();
|
|
|
- } catch (MapperParsingException e) {
|
|
|
- assertParseMinimalWarnings();
|
|
|
- assumeFalse("Field type does not support stored fields", true);
|
|
|
- return;
|
|
|
- }
|
|
|
+ assumeTrue("Field type does not support stored fields", supportsStoredFields());
|
|
|
+ MapperService mapperService = createMapperService(fieldMapping(this::minimalStoreMapping));
|
|
|
+ assertParseMinimalWarnings();
|
|
|
|
|
|
MappedFieldType fieldType = mapperService.fieldType("field");
|
|
|
SourceToParse source = source(this::writeField);
|