Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix issues
  • Loading branch information
Dexter Lee committed Jun 14, 2021
commit 6428d37c807a54b4b7534e3418f1635d1586a303
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ private static Map<String, Object> getMappingsForField(@Nonnull final Searchable
// Add keyword subfield with fielddata set to true for aggregation queries
subFields.put("keyword", ImmutableMap.of("type", "text", "analyzer", "urn_component", "fielddata", true));
}
mappingForField.put("fields", subFields);
if(!subFields.isEmpty()) {
mappingForField.put("fields", subFields);
}
} else if (fieldType == FieldType.BOOLEAN) {
mappingForField.put("type", "boolean");
} else if (fieldType == FieldType.COUNT) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public IndexConventionImpl(@Nullable String prefix) {
}

private String createIndexName(String baseName) {
return (_prefix.map(prefix -> prefix + "_").orElse("") + baseName + SUFFIX + "_" + VERSION).toLowerCase();
return (_prefix.map(prefix -> prefix + "_").orElse("") + baseName).toLowerCase();
}

@Nonnull
Expand All @@ -35,7 +35,7 @@ public String getIndexName(Class<? extends RecordTemplate> documentClass) {
@Nonnull
@Override
public String getIndexName(EntitySpec entitySpec) {
return this.getIndexName(entitySpec.getName());
return this.getIndexName(entitySpec.getName()) + SUFFIX + "_" + VERSION;
}

@Nonnull
Expand Down