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 elastic#6093

closes elastic#6304
  • Loading branch information
brwe committed Jun 2, 2014
1 parent 7452671 commit 78b266a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,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 78b266a

Please sign in to comment.