Skip to content

Commit

Permalink
Fix duplicate mappings issue
Browse files Browse the repository at this point in the history
  • Loading branch information
przemekwitek committed Jun 11, 2019
1 parent 997d196 commit 64b7725
Showing 1 changed file with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ public static XContentBuilder resultsMapping(String mappingType, Collection<Stri
addResultsMapping(builder);
addCategoryDefinitionMapping(builder);
addDataCountsMapping(builder);
addTimingStatsMapping(builder);
addTimingStatsExceptBucketCountMapping(builder);
addModelSnapshotMapping(builder);

addTermFields(builder, extraTermFields);
Expand Down Expand Up @@ -792,7 +792,6 @@ private static void addInfluencerFieldsToMapping(XContentBuilder builder) throws

/**
* {@link DataCounts} mapping.
* The type is disabled so {@link DataCounts} aren't searchable and the '_all' field is disabled
*
* @throws IOException On builder write error
*/
Expand Down Expand Up @@ -849,15 +848,13 @@ private static void addDataCountsMapping(XContentBuilder builder) throws IOExcep

/**
* {@link TimingStats} mapping.
* The type is disabled so {@link TimingStats} aren't searchable and the '_all' field is disabled
* Does not include mapping for BUCKET_COUNT as this mapping is added by {@link #addDataCountsMapping} method.
*
* @throws IOException On builder write error
*/
private static void addTimingStatsMapping(XContentBuilder builder) throws IOException {
private static void addTimingStatsExceptBucketCountMapping(XContentBuilder builder) throws IOException {
builder
.startObject(TimingStats.BUCKET_COUNT.getPreferredName())
.field(TYPE, LONG)
.endObject()
// re-used: BUCKET_COUNT
.startObject(TimingStats.MIN_BUCKET_PROCESSING_TIME_MS.getPreferredName())
.field(TYPE, DOUBLE)
.endObject()
Expand Down

0 comments on commit 64b7725

Please sign in to comment.