Skip to content

Commit

Permalink
Object and Type parsing: Fix include_in_all in type
Browse files Browse the repository at this point in the history
include_in_all can also be set on type level (root object).
This fixes a regression introduced  in #6093

closes #6304
  • Loading branch information
brwe committed Jun 2, 2014
1 parent 2f0f95e commit dafba2e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Expand Up @@ -211,15 +211,16 @@ protected static boolean parseObjectOrDocumentTypeProperties(String fieldName, O
parseProperties(builder, (Map<String, Object>) fieldNode, parserContext);
}
return true;
} else if (fieldName.equals("include_in_all")) {
builder.includeInAll(nodeBooleanValue(fieldNode));
return true;
}
return false;
}

protected static void parseObjectProperties(String name, String fieldName, Object fieldNode, ObjectMapper.Builder builder) {
if (fieldName.equals("path")) {
builder.pathType(parsePathType(name, fieldNode.toString()));
} else if (fieldName.equals("include_in_all")) {
builder.includeInAll(nodeBooleanValue(fieldNode));
}
}

Expand Down
Expand Up @@ -413,6 +413,13 @@ public void testRootMappersStillWorking() {
rootTypes.put(IndexFieldMapper.NAME, "{\"enabled\" : true}");
rootTypes.put(SourceFieldMapper.NAME, "{\"enabled\" : true}");
rootTypes.put(TypeFieldMapper.NAME, "{\"store\" : true}");
rootTypes.put("include_in_all", "true");
rootTypes.put("index_analyzer", "\"standard\"");
rootTypes.put("search_analyzer", "\"standard\"");
rootTypes.put("analyzer", "\"standard\"");
rootTypes.put("dynamic_date_formats", "[\"yyyy-MM-dd\", \"dd-MM-yyyy\"]");
rootTypes.put("numeric_detection", "true");
rootTypes.put("dynamic_templates", "[]");
for (String key : rootTypes.keySet()) {
mapping += "\"" + key+ "\"" + ":" + rootTypes.get(key) + ",\n";
}
Expand Down

0 comments on commit dafba2e

Please sign in to comment.