Skip to content

Add serialization test for FieldMappers when include_defaults=true #58235

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Jun 18, 2020

Conversation

romseygeek
Copy link
Contributor

Fixes a bug in TextFieldMapper serialization when index is false, and adds a
base-class test to ensure that all field mappers are tested against all variations
with defaults both included and excluded.

Fixes #58188

@romseygeek romseygeek requested a review from javanna June 17, 2020 10:16
@romseygeek romseygeek self-assigned this Jun 17, 2020
@romseygeek romseygeek added :Search Foundations/Mapping Index mappings, including merging and defining field types >non-issue v7.9.0 v8.0.0 labels Jun 17, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search (:Search/Mapping)

@elasticmachine elasticmachine added the Team:Search Meta label for search team label Jun 17, 2020
@romseygeek
Copy link
Contributor Author

Marked as non-issue because it's unreleased. #57666 was a beast and it's likely that there are more bugs of this type to be uncovered.

@romseygeek
Copy link
Contributor Author

@elasticmachine update branch

@romseygeek
Copy link
Contributor Author

@elasticmachine update branch

@@ -917,7 +917,8 @@ protected boolean docValuesByDefault() {
@Override
protected void doXContentBody(XContentBuilder builder, boolean includeDefaults, Params params) throws IOException {
super.doXContentBody(builder, includeDefaults, params);
if (includeDefaults || (mappedFieldType.isSearchable() && fieldType.indexOptions() != Defaults.FIELD_TYPE.indexOptions())) {
if ((includeDefaults && fieldType.indexOptions() != IndexOptions.NONE)
|| (mappedFieldType.isSearchable() && fieldType.indexOptions() != Defaults.FIELD_TYPE.indexOptions())) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I struggle to parse this. why do we need to look at both indexOptions and isSearchable? When iis the second condition true in reality?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, you're right, we don't need the isSearchable bit there - will update, thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have pushed a change which simplifies this

@romseygeek romseygeek requested a review from jtibshirani June 17, 2020 15:40
@romseygeek
Copy link
Contributor Author

@elasticmachine run elasticsearch-ci/packaging-sample-unix-packages

@tylersmalley
Copy link
Contributor

tylersmalley commented Jun 17, 2020

This has resolved the initial issue with non-indexed text fields, but I am now seeing the 404 response for those with type keyword

curl -X PUT "localhost:9200/publications?pretty" -H 'Content-Type: application/json' -d'
{
    "mappings": {
        "properties": {
            "id": { "type": "text" },
            "title":  { "type": "text"},
            "abstract": { "type": "keyword", "index": false },
            "author": {
                "properties": {
                    "id": { "type": "text" },
                    "name": { "type": "text" }
                }
            }
        }
    }
}'
curl -X GET "@localhost:9200/_mapping/field/*?index=publications&allow_no_indices=false&include_defaults=true"

Here is a full example for what Kibana is using. The default distribution is required since it includes flattened types:

curl -X DELETE "elastic:changeme@localhost:9200/.kibana"
curl -X PUT "elastic:changeme@localhost:9200/.kibana?pretty" -H 'Content-Type: application/json' -d @mapping.txt
curl -X GET "elastic:changeme@localhost:9200/_mapping/field/*?index=.kibana&allow_no_indices=false&include_defaults=true"
mapping.txt

{
    "mappings" : {
      "dynamic" : "strict",
      "_meta" : {
        "migrationMappingPropertyHashes" : {
          "ml-telemetry" : "257fd1d4b4fdbb9cb4b8a3b27da201e9",
          "visualization" : "52d7a13ad68a150c4525b292d23e12cc",
          "references" : "7997cf5a56cc02bdc9c93361bde732b0",
          "graph-workspace" : "cd7ba1330e6682e9cc00b78850874be1",
          "epm-packages" : "92b4b1899b887b090d01c033f3118a85",
          "type" : "2f4316de49999235636386fe51dc06c1",
          "space" : "c5ca8acafa0beaa4d08d014a97b6bc6b",
          "infrastructure-ui-source" : "ddc0ecb18383f6b26101a2fadb2dab0c",
          "ingest_manager_settings" : "c5b0749b4ab03c582efd4c14cb8f132c",
          "application_usage_totals" : "c897e4310c5f24b07caaff3db53ae2c1",
          "action" : "6e96ac5e648f57523879661ea72525b7",
          "dashboard" : "d00f614b29a80360e1190193fd333bab",
          "metrics-explorer-view" : "428e319af3e822c80a84cf87123ca35c",
          "siem-detection-engine-rule-actions" : "6569b288c169539db10cb262bf79de18",
          "query" : "11aaeb7f5f7fa5bb43f25e18ce26e7d9",
          "file-upload-telemetry" : "0ed4d3e1983d1217a30982630897092e",
          "application_usage_transactional" : "965839e75f809fefe04f92dc4d99722a",
          "action_task_params" : "a9d49f184ee89641044be0ca2950fa3a",
          "fleet-agent-events" : "3231653fafe4ef3196fe3b32ab774bf2",
          "ingest-datasources" : "c0fe6347b0eebcbf421841669e3acd31",
          "apm-indices" : "9bb9b2bf1fa636ed8619cbab5ce6a1dd",
          "inventory-view" : "88fc7e12fd1b45b6f0787323ce4f18d2",
          "upgrade-assistant-reindex-operation" : "296a89039fc4260292be36b1b005d8f2",
          "cases-comments" : "c2061fb929f585df57425102fa928b4b",
          "fleet-enrollment-api-keys" : "28b91e20b105b6f928e2012600085d8f",
          "canvas-element" : "7390014e1091044523666d97247392fc",
          "ingest-outputs" : "0e57221778a7153c8292edf154099036",
          "telemetry" : "36a616f7026dfa617d6655df850fe16d",
          "upgrade-assistant-telemetry" : "56702cec857e0a9dacfb696655b4ff7b",
          "lens-ui-telemetry" : "509bfa5978586998e05f9e303c07a327",
          "namespaces" : "2f4316de49999235636386fe51dc06c1",
          "siem-ui-timeline-note" : "8874706eedc49059d4cf0f5094559084",
          "lens" : "d33c68a69ff1e78c9888dedd2164ac22",
          "sample-data-telemetry" : "7d3cfeb915303c9641c59681967ffeb4",
          "fleet-agent-actions" : "e520c855577170c24481be05c3ae14ec",
          "search" : "181661168bbadd1eff5902361e2a0d5c",
          "updated_at" : "00da57df13e94e9d98437d13ace4bfe0",
          "cases-configure" : "42711cbb311976c0687853f4c1354572",
          "canvas-workpad" : "b0a1706d356228dbdcb4a17e6b9eb231",
          "alert" : "7b44fba6773e37c806ce290ea9b7024e",
          "siem-detection-engine-rule-status" : "ae783f41c6937db6b7a2ef5c93a9e9b0",
          "map" : "23d7aa4a720d4938ccde3983f87bd58d",
          "uptime-dynamic-settings" : "fcdb453a30092f022f2642db29523d80",
          "cases" : "32aa96a6d3855ddda53010ae2048ac22",
          "apm-telemetry" : "3525d7c22c42bc80f5e6e9cb3f2b26a2",
          "siem-ui-timeline" : "17ec409954864e592ceec0c5eae29ad9",
          "kql-telemetry" : "d12a98a6f19a2d273696597547e064ee",
          "ui-metric" : "0d409297dc5ebe1e3a1da691c6ee32e3",
          "ingest-agent-configs" : "d9a5cbdce8e937f674a7b376c47a34a1",
          "url" : "b675c3be8d76ecf029294d51dc7ec65d",
          "migrationVersion" : "4a1746014a75ade3a714e1db5763276f",
          "index-pattern" : "66eccb05066c5a89924f48a9e9736499",
          "fleet-agents" : "864760267df6c970f629bd4458506c53",
          "maps-telemetry" : "bfd39d88aadadb4be597ea984d433dbe",
          "namespace" : "2f4316de49999235636386fe51dc06c1",
          "cases-user-actions" : "32277330ec6b721abe3b846cfd939a71",
          "timelion-sheet" : "9a2a2748877c7a7b582fef201ab1d4cf",
          "siem-ui-timeline-pinned-event" : "20638091112f0e14f0e443d512301c29",
          "config" : "ae24d22d5986d04124cc6568f771066f",
          "tsvb-validation-telemetry" : "3a37ef6c8700ae6fc97d5c7da00e9215"
        }
      },
      "properties" : {
        "action" : {
          "properties" : {
            "actionTypeId" : {
              "type" : "keyword"
            },
            "config" : {
              "type" : "object",
              "enabled" : false
            },
            "name" : {
              "type" : "text",
              "fields" : {
                "keyword" : {
                  "type" : "keyword"
                }
              }
            },
            "secrets" : {
              "type" : "binary",
              "index" : false
            }
          }
        },
        "action_task_params" : {
          "properties" : {
            "actionId" : {
              "type" : "keyword"
            },
            "apiKey" : {
              "type" : "binary",
              "index" : false
            },
            "params" : {
              "type" : "object",
              "enabled" : false
            }
          }
        },
        "alert" : {
          "properties" : {
            "actions" : {
              "type" : "nested",
              "properties" : {
                "actionRef" : {
                  "type" : "keyword"
                },
                "actionTypeId" : {
                  "type" : "keyword"
                },
                "group" : {
                  "type" : "keyword"
                },
                "params" : {
                  "type" : "object",
                  "enabled" : false
                }
              }
            },
            "alertTypeId" : {
              "type" : "keyword"
            },
            "apiKey" : {
              "type" : "binary",
              "index" : false
            },
            "apiKeyOwner" : {
              "type" : "keyword"
            },
            "consumer" : {
              "type" : "keyword"
            },
            "createdAt" : {
              "type" : "date"
            },
            "createdBy" : {
              "type" : "keyword"
            },
            "enabled" : {
              "type" : "boolean"
            },
            "muteAll" : {
              "type" : "boolean"
            },
            "mutedInstanceIds" : {
              "type" : "keyword"
            },
            "name" : {
              "type" : "text",
              "fields" : {
                "keyword" : {
                  "type" : "keyword"
                }
              }
            },
            "params" : {
              "type" : "object",
              "enabled" : false
            },
            "schedule" : {
              "properties" : {
                "interval" : {
                  "type" : "keyword"
                }
              }
            },
            "scheduledTaskId" : {
              "type" : "keyword"
            },
            "tags" : {
              "type" : "keyword"
            },
            "throttle" : {
              "type" : "keyword"
            },
            "updatedBy" : {
              "type" : "keyword"
            }
          }
        },
        "apm-indices" : {
          "properties" : {
            "apm_oss" : {
              "properties" : {
                "errorIndices" : {
                  "type" : "keyword"
                },
                "metricsIndices" : {
                  "type" : "keyword"
                },
                "onboardingIndices" : {
                  "type" : "keyword"
                },
                "sourcemapIndices" : {
                  "type" : "keyword"
                },
                "spanIndices" : {
                  "type" : "keyword"
                },
                "transactionIndices" : {
                  "type" : "keyword"
                }
              }
            }
          }
        },
        "apm-telemetry" : {
          "properties" : {
            "agents" : {
              "properties" : {
                "dotnet" : {
                  "properties" : {
                    "agent" : {
                      "properties" : {
                        "version" : {
                          "type" : "keyword",
                          "ignore_above" : 1024
                        }
                      }
                    },
                    "service" : {
                      "properties" : {
                        "framework" : {
                          "properties" : {
                            "composite" : {
                              "type" : "keyword",
                              "ignore_above" : 1024
                            },
                            "name" : {
                              "type" : "keyword",
                              "ignore_above" : 1024
                            },
                            "version" : {
                              "type" : "keyword",
                              "ignore_above" : 1024
                            }
                          }
                        },
                        "language" : {
                          "properties" : {
                            "composite" : {
                              "type" : "keyword",
                              "ignore_above" : 1024
                            },
                            "name" : {
                              "type" : "keyword",
                              "ignore_above" : 1024
                            },
                            "version" : {
                              "type" : "keyword",
                              "ignore_above" : 1024
                            }
                          }
                        },
                        "runtime" : {
                          "properties" : {
                            "composite" : {
                              "type" : "keyword",
                              "ignore_above" : 1024
                            },
                            "name" : {
                              "type" : "keyword",
                              "ignore_above" : 1024
                            },
                            "version" : {
                              "type" : "keyword",
                              "ignore_above" : 1024
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "go" : {
                  "properties" : {
                    "agent" : {
                      "properties" : {
                        "version" : {
                          "type" : "keyword",
                          "ignore_above" : 1024
                        }
                      }
                    },
                    "service" : {
                      "properties" : {
                        "framework" : {
                          "properties" : {
                            "composite" : {
                              "type" : "keyword",
                              "ignore_above" : 1024
                            },
                            "name" : {
                              "type" : "keyword",
                              "ignore_above" : 1024
                            },
                            "version" : {
                              "type" : "keyword",
                              "ignore_above" : 1024
                            }
                          }
                        },
                        "language" : {
                          "properties" : {
                            "composite" : {
                              "type" : "keyword",
                              "ignore_above" : 1024
                            },
                            "name" : {
                              "type" : "keyword",
                              "ignore_above" : 1024
                            },
                            "version" : {
                              "type" : "keyword",
                              "ignore_above" : 1024
                            }
                          }
                        },
                        "runtime" : {
                          "properties" : {
                            "composite" : {
                              "type" : "keyword",
                              "ignore_above" : 1024
                            },
                            "name" : {
                              "type" : "keyword",
                              "ignore_above" : 1024
                            },
                            "version" : {
                              "type" : "keyword",
                              "ignore_above" : 1024
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "java" : {
                  "properties" : {
                    "agent" : {
                      "properties" : {
                        "version" : {
                          "type" : "keyword",
                          "ignore_above" : 1024
                        }
                      }
                    },
                    "service" : {
                      "properties" : {
                        "framework" : {
                          "properties" : {
                            "composite" : {
                              "type" : "keyword",
                              "ignore_above" : 1024
                            },
                            "name" : {
                              "type" : "keyword",
                              "ignore_above" : 1024
                            },
                            "version" : {
                              "type" : "keyword",
                              "ignore_above" : 1024
                            }
                          }
                        },
                        "language" : {
                          "properties" : {
                            "composite" : {
                              "type" : "keyword",
                              "ignore_above" : 1024
                            },
                            "name" : {
                              "type" : "keyword",
                              "ignore_above" : 1024
                            },
                            "version" : {
                              "type" : "keyword",
                              "ignore_above" : 1024
                            }
                          }
                        },
                        "runtime" : {
                          "properties" : {
                            "composite" : {
                              "type" : "keyword",
                              "ignore_above" : 1024
                            },
                            "name" : {
                              "type" : "keyword",
                              "ignore_above" : 1024
                            },
                            "version" : {
                              "type" : "keyword",
                              "ignore_above" : 1024
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "js-base" : {
                  "properties" : {
                    "agent" : {
                      "properties" : {
                        "version" : {
                          "type" : "keyword",
                          "ignore_above" : 1024
                        }
                      }
                    },
                    "service" : {
                      "properties" : {
                        "framework" : {
                          "properties" : {
                            "composite" : {
                              "type" : "keyword",
                              "ignore_above" : 1024
                            },
                            "name" : {
                              "type" : "keyword",
                              "ignore_above" : 1024
                            },
                            "version" : {
                              "type" : "keyword",
                              "ignore_above" : 1024
                            }
                          }
                        },
                        "language" : {
                          "properties" : {
                            "composite" : {
                              "type" : "keyword",
                              "ignore_above" : 1024
                            },
                            "name" : {
                              "type" : "keyword",
                              "ignore_above" : 1024
                            },
                            "version" : {
                              "type" : "keyword",
                              "ignore_above" : 1024
                            }
                          }
                        },
                        "runtime" : {
                          "properties" : {
                            "composite" : {
                              "type" : "keyword",
                              "ignore_above" : 1024
                            },
                            "name" : {
                              "type" : "keyword",
                              "ignore_above" : 1024
                            },
                            "version" : {
                              "type" : "keyword",
                              "ignore_above" : 1024
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "nodejs" : {
                  "properties" : {
                    "agent" : {
                      "properties" : {
                        "version" : {
                          "type" : "keyword",
                          "ignore_above" : 1024
                        }
                      }
                    },
                    "service" : {
                      "properties" : {
                        "framework" : {
                          "properties" : {
                            "composite" : {
                              "type" : "keyword",
                              "ignore_above" : 1024
                            },
                            "name" : {
                              "type" : "keyword",
                              "ignore_above" : 1024
                            },
                            "version" : {
                              "type" : "keyword",
                              "ignore_above" : 1024
                            }
                          }
                        },
                        "language" : {
                          "properties" : {
                            "composite" : {
                              "type" : "keyword",
                              "ignore_above" : 1024
                            },
                            "name" : {
                              "type" : "keyword",
                              "ignore_above" : 1024
                            },
                            "version" : {
                              "type" : "keyword",
                              "ignore_above" : 1024
                            }
                          }
                        },
                        "runtime" : {
                          "properties" : {
                            "composite" : {
                              "type" : "keyword",
                              "ignore_above" : 1024
                            },
                            "name" : {
                              "type" : "keyword",
                              "ignore_above" : 1024
                            },
                            "version" : {
                              "type" : "keyword",
                              "ignore_above" : 1024
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "python" : {
                  "properties" : {
                    "agent" : {
                      "properties" : {
                        "version" : {
                          "type" : "keyword",
                          "ignore_above" : 1024
                        }
                      }
                    },
                    "service" : {
                      "properties" : {
                        "framework" : {
                          "properties" : {
                            "composite" : {
                              "type" : "keyword",
                              "ignore_above" : 1024
                            },
                            "name" : {
                              "type" : "keyword",
                              "ignore_above" : 1024
                            },
                            "version" : {
                              "type" : "keyword",
                              "ignore_above" : 1024
                            }
                          }
                        },
                        "language" : {
                          "properties" : {
                            "composite" : {
                              "type" : "keyword",
                              "ignore_above" : 1024
                            },
                            "name" : {
                              "type" : "keyword",
                              "ignore_above" : 1024
                            },
                            "version" : {
                              "type" : "keyword",
                              "ignore_above" : 1024
                            }
                          }
                        },
                        "runtime" : {
                          "properties" : {
                            "composite" : {
                              "type" : "keyword",
                              "ignore_above" : 1024
                            },
                            "name" : {
                              "type" : "keyword",
                              "ignore_above" : 1024
                            },
                            "version" : {
                              "type" : "keyword",
                              "ignore_above" : 1024
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "ruby" : {
                  "properties" : {
                    "agent" : {
                      "properties" : {
                        "version" : {
                          "type" : "keyword",
                          "ignore_above" : 1024
                        }
                      }
                    },
                    "service" : {
                      "properties" : {
                        "framework" : {
                          "properties" : {
                            "composite" : {
                              "type" : "keyword",
                              "ignore_above" : 1024
                            },
                            "name" : {
                              "type" : "keyword",
                              "ignore_above" : 1024
                            },
                            "version" : {
                              "type" : "keyword",
                              "ignore_above" : 1024
                            }
                          }
                        },
                        "language" : {
                          "properties" : {
                            "composite" : {
                              "type" : "keyword",
                              "ignore_above" : 1024
                            },
                            "name" : {
                              "type" : "keyword",
                              "ignore_above" : 1024
                            },
                            "version" : {
                              "type" : "keyword",
                              "ignore_above" : 1024
                            }
                          }
                        },
                        "runtime" : {
                          "properties" : {
                            "composite" : {
                              "type" : "keyword",
                              "ignore_above" : 1024
                            },
                            "name" : {
                              "type" : "keyword",
                              "ignore_above" : 1024
                            },
                            "version" : {
                              "type" : "keyword",
                              "ignore_above" : 1024
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "rum-js" : {
                  "properties" : {
                    "agent" : {
                      "properties" : {
                        "version" : {
                          "type" : "keyword",
                          "ignore_above" : 1024
                        }
                      }
                    },
                    "service" : {
                      "properties" : {
                        "framework" : {
                          "properties" : {
                            "composite" : {
                              "type" : "keyword",
                              "ignore_above" : 1024
                            },
                            "name" : {
                              "type" : "keyword",
                              "ignore_above" : 1024
                            },
                            "version" : {
                              "type" : "keyword",
                              "ignore_above" : 1024
                            }
                          }
                        },
                        "language" : {
                          "properties" : {
                            "composite" : {
                              "type" : "keyword",
                              "ignore_above" : 1024
                            },
                            "name" : {
                              "type" : "keyword",
                              "ignore_above" : 1024
                            },
                            "version" : {
                              "type" : "keyword",
                              "ignore_above" : 1024
                            }
                          }
                        },
                        "runtime" : {
                          "properties" : {
                            "composite" : {
                              "type" : "keyword",
                              "ignore_above" : 1024
                            },
                            "name" : {
                              "type" : "keyword",
                              "ignore_above" : 1024
                            },
                            "version" : {
                              "type" : "keyword",
                              "ignore_above" : 1024
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            },
            "cardinality" : {
              "properties" : {
                "transaction" : {
                  "properties" : {
                    "name" : {
                      "properties" : {
                        "all_agents" : {
                          "properties" : {
                            "1d" : {
                              "type" : "long"
                            }
                          }
                        },
                        "rum" : {
                          "properties" : {
                            "1d" : {
                              "type" : "long"
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "user_agent" : {
                  "properties" : {
                    "original" : {
                      "properties" : {
                        "all_agents" : {
                          "properties" : {
                            "1d" : {
                              "type" : "long"
                            }
                          }
                        },
                        "rum" : {
                          "properties" : {
                            "1d" : {
                              "type" : "long"
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            },
            "counts" : {
              "properties" : {
                "agent_configuration" : {
                  "properties" : {
                    "all" : {
                      "type" : "long"
                    }
                  }
                },
                "error" : {
                  "properties" : {
                    "1d" : {
                      "type" : "long"
                    },
                    "all" : {
                      "type" : "long"
                    }
                  }
                },
                "max_error_groups_per_service" : {
                  "properties" : {
                    "1d" : {
                      "type" : "long"
                    }
                  }
                },
                "max_transaction_groups_per_service" : {
                  "properties" : {
                    "1d" : {
                      "type" : "long"
                    }
                  }
                },
                "metric" : {
                  "properties" : {
                    "1d" : {
                      "type" : "long"
                    },
                    "all" : {
                      "type" : "long"
                    }
                  }
                },
                "onboarding" : {
                  "properties" : {
                    "1d" : {
                      "type" : "long"
                    },
                    "all" : {
                      "type" : "long"
                    }
                  }
                },
                "services" : {
                  "properties" : {
                    "1d" : {
                      "type" : "long"
                    }
                  }
                },
                "sourcemap" : {
                  "properties" : {
                    "1d" : {
                      "type" : "long"
                    },
                    "all" : {
                      "type" : "long"
                    }
                  }
                },
                "span" : {
                  "properties" : {
                    "1d" : {
                      "type" : "long"
                    },
                    "all" : {
                      "type" : "long"
                    }
                  }
                },
                "traces" : {
                  "properties" : {
                    "1d" : {
                      "type" : "long"
                    }
                  }
                },
                "transaction" : {
                  "properties" : {
                    "1d" : {
                      "type" : "long"
                    },
                    "all" : {
                      "type" : "long"
                    }
                  }
                }
              }
            },
            "has_any_services" : {
              "type" : "boolean"
            },
            "indices" : {
              "properties" : {
                "all" : {
                  "properties" : {
                    "total" : {
                      "properties" : {
                        "docs" : {
                          "properties" : {
                            "count" : {
                              "type" : "long"
                            }
                          }
                        },
                        "store" : {
                          "properties" : {
                            "size_in_bytes" : {
                              "type" : "long"
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "shards" : {
                  "properties" : {
                    "total" : {
                      "type" : "long"
                    }
                  }
                }
              }
            },
            "integrations" : {
              "properties" : {
                "ml" : {
                  "properties" : {
                    "all_jobs_count" : {
                      "type" : "long"
                    }
                  }
                }
              }
            },
            "retainment" : {
              "properties" : {
                "error" : {
                  "properties" : {
                    "ms" : {
                      "type" : "long"
                    }
                  }
                },
                "metric" : {
                  "properties" : {
                    "ms" : {
                      "type" : "long"
                    }
                  }
                },
                "onboarding" : {
                  "properties" : {
                    "ms" : {
                      "type" : "long"
                    }
                  }
                },
                "span" : {
                  "properties" : {
                    "ms" : {
                      "type" : "long"
                    }
                  }
                },
                "transaction" : {
                  "properties" : {
                    "ms" : {
                      "type" : "long"
                    }
                  }
                }
              }
            },
            "services_per_agent" : {
              "properties" : {
                "dotnet" : {
                  "type" : "long",
                  "null_value" : 0
                },
                "go" : {
                  "type" : "long",
                  "null_value" : 0
                },
                "java" : {
                  "type" : "long",
                  "null_value" : 0
                },
                "js-base" : {
                  "type" : "long",
                  "null_value" : 0
                },
                "nodejs" : {
                  "type" : "long",
                  "null_value" : 0
                },
                "python" : {
                  "type" : "long",
                  "null_value" : 0
                },
                "ruby" : {
                  "type" : "long",
                  "null_value" : 0
                },
                "rum-js" : {
                  "type" : "long",
                  "null_value" : 0
                }
              }
            },
            "tasks" : {
              "properties" : {
                "agent_configuration" : {
                  "properties" : {
                    "took" : {
                      "properties" : {
                        "ms" : {
                          "type" : "long"
                        }
                      }
                    }
                  }
                },
                "agents" : {
                  "properties" : {
                    "took" : {
                      "properties" : {
                        "ms" : {
                          "type" : "long"
                        }
                      }
                    }
                  }
                },
                "cardinality" : {
                  "properties" : {
                    "took" : {
                      "properties" : {
                        "ms" : {
                          "type" : "long"
                        }
                      }
                    }
                  }
                },
                "groupings" : {
                  "properties" : {
                    "took" : {
                      "properties" : {
                        "ms" : {
                          "type" : "long"
                        }
                      }
                    }
                  }
                },
                "indices_stats" : {
                  "properties" : {
                    "took" : {
                      "properties" : {
                        "ms" : {
                          "type" : "long"
                        }
                      }
                    }
                  }
                },
                "integrations" : {
                  "properties" : {
                    "took" : {
                      "properties" : {
                        "ms" : {
                          "type" : "long"
                        }
                      }
                    }
                  }
                },
                "processor_events" : {
                  "properties" : {
                    "took" : {
                      "properties" : {
                        "ms" : {
                          "type" : "long"
                        }
                      }
                    }
                  }
                },
                "services" : {
                  "properties" : {
                    "took" : {
                      "properties" : {
                        "ms" : {
                          "type" : "long"
                        }
                      }
                    }
                  }
                },
                "versions" : {
                  "properties" : {
                    "took" : {
                      "properties" : {
                        "ms" : {
                          "type" : "long"
                        }
                      }
                    }
                  }
                }
              }
            },
            "version" : {
              "properties" : {
                "apm_server" : {
                  "properties" : {
                    "major" : {
                      "type" : "long"
                    },
                    "minor" : {
                      "type" : "long"
                    },
                    "patch" : {
                      "type" : "long"
                    }
                  }
                }
              }
            }
          }
        },
        "application_usage_totals" : {
          "properties" : {
            "appId" : {
              "type" : "keyword"
            },
            "minutesOnScreen" : {
              "type" : "float"
            },
            "numberOfClicks" : {
              "type" : "long"
            }
          }
        },
        "application_usage_transactional" : {
          "properties" : {
            "appId" : {
              "type" : "keyword"
            },
            "minutesOnScreen" : {
              "type" : "float"
            },
            "numberOfClicks" : {
              "type" : "long"
            },
            "timestamp" : {
              "type" : "date"
            }
          }
        },
        "canvas-element" : {
          "dynamic" : "false",
          "properties" : {
            "@created" : {
              "type" : "date"
            },
            "@timestamp" : {
              "type" : "date"
            },
            "content" : {
              "type" : "text"
            },
            "help" : {
              "type" : "text"
            },
            "image" : {
              "type" : "text"
            },
            "name" : {
              "type" : "text",
              "fields" : {
                "keyword" : {
                  "type" : "keyword"
                }
              }
            }
          }
        },
        "canvas-workpad" : {
          "dynamic" : "false",
          "properties" : {
            "@created" : {
              "type" : "date"
            },
            "@timestamp" : {
              "type" : "date"
            },
            "name" : {
              "type" : "text",
              "fields" : {
                "keyword" : {
                  "type" : "keyword"
                }
              }
            }
          }
        },
        "cases" : {
          "properties" : {
            "closed_at" : {
              "type" : "date"
            },
            "closed_by" : {
              "properties" : {
                "email" : {
                  "type" : "keyword"
                },
                "full_name" : {
                  "type" : "keyword"
                },
                "username" : {
                  "type" : "keyword"
                }
              }
            },
            "connector_id" : {
              "type" : "keyword"
            },
            "created_at" : {
              "type" : "date"
            },
            "created_by" : {
              "properties" : {
                "email" : {
                  "type" : "keyword"
                },
                "full_name" : {
                  "type" : "keyword"
                },
                "username" : {
                  "type" : "keyword"
                }
              }
            },
            "description" : {
              "type" : "text"
            },
            "external_service" : {
              "properties" : {
                "connector_id" : {
                  "type" : "keyword"
                },
                "connector_name" : {
                  "type" : "keyword"
                },
                "external_id" : {
                  "type" : "keyword"
                },
                "external_title" : {
                  "type" : "text"
                },
                "external_url" : {
                  "type" : "text"
                },
                "pushed_at" : {
                  "type" : "date"
                },
                "pushed_by" : {
                  "properties" : {
                    "email" : {
                      "type" : "keyword"
                    },
                    "full_name" : {
                      "type" : "keyword"
                    },
                    "username" : {
                      "type" : "keyword"
                    }
                  }
                }
              }
            },
            "status" : {
              "type" : "keyword"
            },
            "tags" : {
              "type" : "keyword"
            },
            "title" : {
              "type" : "keyword"
            },
            "updated_at" : {
              "type" : "date"
            },
            "updated_by" : {
              "properties" : {
                "email" : {
                  "type" : "keyword"
                },
                "full_name" : {
                  "type" : "keyword"
                },
                "username" : {
                  "type" : "keyword"
                }
              }
            }
          }
        },
        "cases-comments" : {
          "properties" : {
            "comment" : {
              "type" : "text"
            },
            "created_at" : {
              "type" : "date"
            },
            "created_by" : {
              "properties" : {
                "email" : {
                  "type" : "keyword"
                },
                "full_name" : {
                  "type" : "keyword"
                },
                "username" : {
                  "type" : "keyword"
                }
              }
            },
            "pushed_at" : {
              "type" : "date"
            },
            "pushed_by" : {
              "properties" : {
                "email" : {
                  "type" : "keyword"
                },
                "full_name" : {
                  "type" : "keyword"
                },
                "username" : {
                  "type" : "keyword"
                }
              }
            },
            "updated_at" : {
              "type" : "date"
            },
            "updated_by" : {
              "properties" : {
                "email" : {
                  "type" : "keyword"
                },
                "full_name" : {
                  "type" : "keyword"
                },
                "username" : {
                  "type" : "keyword"
                }
              }
            }
          }
        },
        "cases-configure" : {
          "properties" : {
            "closure_type" : {
              "type" : "keyword"
            },
            "connector_id" : {
              "type" : "keyword"
            },
            "connector_name" : {
              "type" : "keyword"
            },
            "created_at" : {
              "type" : "date"
            },
            "created_by" : {
              "properties" : {
                "email" : {
                  "type" : "keyword"
                },
                "full_name" : {
                  "type" : "keyword"
                },
                "username" : {
                  "type" : "keyword"
                }
              }
            },
            "updated_at" : {
              "type" : "date"
            },
            "updated_by" : {
              "properties" : {
                "email" : {
                  "type" : "keyword"
                },
                "full_name" : {
                  "type" : "keyword"
                },
                "username" : {
                  "type" : "keyword"
                }
              }
            }
          }
        },
        "cases-user-actions" : {
          "properties" : {
            "action" : {
              "type" : "keyword"
            },
            "action_at" : {
              "type" : "date"
            },
            "action_by" : {
              "properties" : {
                "email" : {
                  "type" : "keyword"
                },
                "full_name" : {
                  "type" : "keyword"
                },
                "username" : {
                  "type" : "keyword"
                }
              }
            },
            "action_field" : {
              "type" : "keyword"
            },
            "new_value" : {
              "type" : "text"
            },
            "old_value" : {
              "type" : "text"
            }
          }
        },
        "config" : {
          "dynamic" : "true",
          "properties" : {
            "buildNum" : {
              "type" : "keyword"
            }
          }
        },
        "dashboard" : {
          "properties" : {
            "description" : {
              "type" : "text"
            },
            "hits" : {
              "type" : "integer"
            },
            "kibanaSavedObjectMeta" : {
              "properties" : {
                "searchSourceJSON" : {
                  "type" : "text"
                }
              }
            },
            "optionsJSON" : {
              "type" : "text"
            },
            "panelsJSON" : {
              "type" : "text"
            },
            "refreshInterval" : {
              "properties" : {
                "display" : {
                  "type" : "keyword"
                },
                "pause" : {
                  "type" : "boolean"
                },
                "section" : {
                  "type" : "integer"
                },
                "value" : {
                  "type" : "integer"
                }
              }
            },
            "timeFrom" : {
              "type" : "keyword"
            },
            "timeRestore" : {
              "type" : "boolean"
            },
            "timeTo" : {
              "type" : "keyword"
            },
            "title" : {
              "type" : "text"
            },
            "version" : {
              "type" : "integer"
            }
          }
        },
        "epm-packages" : {
          "properties" : {
            "es_index_patterns" : {
              "type" : "object",
              "dynamic" : "false"
            },
            "installed" : {
              "type" : "nested",
              "properties" : {
                "id" : {
                  "type" : "keyword"
                },
                "type" : {
                  "type" : "keyword"
                }
              }
            },
            "internal" : {
              "type" : "boolean"
            },
            "name" : {
              "type" : "keyword"
            },
            "removable" : {
              "type" : "boolean"
            },
            "version" : {
              "type" : "keyword"
            }
          }
        },
        "file-upload-telemetry" : {
          "properties" : {
            "filesUploadedTotalCount" : {
              "type" : "long"
            }
          }
        },
        "fleet-agent-actions" : {
          "properties" : {
            "agent_id" : {
              "type" : "keyword"
            },
            "created_at" : {
              "type" : "date"
            },
            "data" : {
              "type" : "binary",
              "index" : false
            },
            "sent_at" : {
              "type" : "date"
            },
            "type" : {
              "type" : "keyword"
            }
          }
        },
        "fleet-agent-events" : {
          "properties" : {
            "action_id" : {
              "type" : "keyword"
            },
            "agent_id" : {
              "type" : "keyword"
            },
            "config_id" : {
              "type" : "keyword"
            },
            "data" : {
              "type" : "text"
            },
            "message" : {
              "type" : "text"
            },
            "payload" : {
              "type" : "text"
            },
            "stream_id" : {
              "type" : "keyword"
            },
            "subtype" : {
              "type" : "keyword"
            },
            "timestamp" : {
              "type" : "date"
            },
            "type" : {
              "type" : "keyword"
            }
          }
        },
        "fleet-agents" : {
          "properties" : {
            "access_api_key_id" : {
              "type" : "keyword"
            },
            "active" : {
              "type" : "boolean"
            },
            "config_id" : {
              "type" : "keyword"
            },
            "config_newest_revision" : {
              "type" : "integer"
            },
            "config_revision" : {
              "type" : "integer"
            },
            "current_error_events" : {
              "type" : "text"
            },
            "default_api_key" : {
              "type" : "keyword"
            },
            "default_api_key_id" : {
              "type" : "keyword"
            },
            "enrolled_at" : {
              "type" : "date"
            },
            "last_checkin" : {
              "type" : "date"
            },
            "last_updated" : {
              "type" : "date"
            },
            "local_metadata" : {
              "type" : "flattened"
            },
            "shared_id" : {
              "type" : "keyword"
            },
            "type" : {
              "type" : "keyword"
            },
            "updated_at" : {
              "type" : "date"
            },
            "user_provided_metadata" : {
              "type" : "flattened"
            },
            "version" : {
              "type" : "keyword"
            }
          }
        },
        "fleet-enrollment-api-keys" : {
          "properties" : {
            "active" : {
              "type" : "boolean"
            },
            "api_key" : {
              "type" : "binary",
              "index" : false
            },
            "api_key_id" : {
              "type" : "keyword"
            },
            "config_id" : {
              "type" : "keyword"
            },
            "created_at" : {
              "type" : "date"
            },
            "expire_at" : {
              "type" : "date"
            },
            "name" : {
              "type" : "keyword"
            },
            "type" : {
              "type" : "keyword"
            },
            "updated_at" : {
              "type" : "date"
            }
          }
        },
        "graph-workspace" : {
          "properties" : {
            "description" : {
              "type" : "text"
            },
            "kibanaSavedObjectMeta" : {
              "properties" : {
                "searchSourceJSON" : {
                  "type" : "text"
                }
              }
            },
            "numLinks" : {
              "type" : "integer"
            },
            "numVertices" : {
              "type" : "integer"
            },
            "title" : {
              "type" : "text"
            },
            "version" : {
              "type" : "integer"
            },
            "wsState" : {
              "type" : "text"
            }
          }
        },
        "index-pattern" : {
          "properties" : {
            "fieldFormatMap" : {
              "type" : "text"
            },
            "fields" : {
              "type" : "text"
            },
            "intervalName" : {
              "type" : "keyword"
            },
            "notExpandable" : {
              "type" : "boolean"
            },
            "sourceFilters" : {
              "type" : "text"
            },
            "timeFieldName" : {
              "type" : "keyword"
            },
            "title" : {
              "type" : "text"
            },
            "type" : {
              "type" : "keyword"
            },
            "typeMeta" : {
              "type" : "keyword"
            }
          }
        },
        "infrastructure-ui-source" : {
          "properties" : {
            "description" : {
              "type" : "text"
            },
            "fields" : {
              "properties" : {
                "container" : {
                  "type" : "keyword"
                },
                "host" : {
                  "type" : "keyword"
                },
                "pod" : {
                  "type" : "keyword"
                },
                "tiebreaker" : {
                  "type" : "keyword"
                },
                "timestamp" : {
                  "type" : "keyword"
                }
              }
            },
            "logAlias" : {
              "type" : "keyword"
            },
            "logColumns" : {
              "type" : "nested",
              "properties" : {
                "fieldColumn" : {
                  "properties" : {
                    "field" : {
                      "type" : "keyword"
                    },
                    "id" : {
                      "type" : "keyword"
                    }
                  }
                },
                "messageColumn" : {
                  "properties" : {
                    "id" : {
                      "type" : "keyword"
                    }
                  }
                },
                "timestampColumn" : {
                  "properties" : {
                    "id" : {
                      "type" : "keyword"
                    }
                  }
                }
              }
            },
            "metricAlias" : {
              "type" : "keyword"
            },
            "name" : {
              "type" : "text"
            }
          }
        },
        "ingest-agent-configs" : {
          "properties" : {
            "datasources" : {
              "type" : "keyword"
            },
            "description" : {
              "type" : "text"
            },
            "id" : {
              "type" : "keyword"
            },
            "is_default" : {
              "type" : "boolean"
            },
            "monitoring_enabled" : {
              "type" : "keyword"
            },
            "name" : {
              "type" : "text"
            },
            "namespace" : {
              "type" : "keyword"
            },
            "revision" : {
              "type" : "integer"
            },
            "status" : {
              "type" : "keyword"
            },
            "updated_at" : {
              "type" : "date"
            },
            "updated_by" : {
              "type" : "keyword"
            }
          }
        },
        "ingest-datasources" : {
          "properties" : {
            "config_id" : {
              "type" : "keyword"
            },
            "created_at" : {
              "type" : "date"
            },
            "created_by" : {
              "type" : "keyword"
            },
            "description" : {
              "type" : "text"
            },
            "enabled" : {
              "type" : "boolean"
            },
            "inputs" : {
              "type" : "nested",
              "properties" : {
                "config" : {
                  "type" : "flattened"
                },
                "enabled" : {
                  "type" : "boolean"
                },
                "processors" : {
                  "type" : "keyword"
                },
                "streams" : {
                  "type" : "nested",
                  "properties" : {
                    "agent_stream" : {
                      "type" : "flattened"
                    },
                    "config" : {
                      "type" : "flattened"
                    },
                    "dataset" : {
                      "type" : "keyword"
                    },
                    "enabled" : {
                      "type" : "boolean"
                    },
                    "id" : {
                      "type" : "keyword"
                    },
                    "processors" : {
                      "type" : "keyword"
                    },
                    "vars" : {
                      "type" : "flattened"
                    }
                  }
                },
                "type" : {
                  "type" : "keyword"
                },
                "vars" : {
                  "type" : "flattened"
                }
              }
            },
            "name" : {
              "type" : "keyword"
            },
            "namespace" : {
              "type" : "keyword"
            },
            "output_id" : {
              "type" : "keyword"
            },
            "package" : {
              "properties" : {
                "name" : {
                  "type" : "keyword"
                },
                "title" : {
                  "type" : "keyword"
                },
                "version" : {
                  "type" : "keyword"
                }
              }
            },
            "revision" : {
              "type" : "integer"
            },
            "updated_at" : {
              "type" : "date"
            },
            "updated_by" : {
              "type" : "keyword"
            }
          }
        },
        "ingest-outputs" : {
          "properties" : {
            "ca_sha256" : {
              "type" : "keyword"
            },
            "config" : {
              "type" : "flattened"
            },
            "fleet_enroll_password" : {
              "type" : "binary",
              "index" : false
            },
            "fleet_enroll_username" : {
              "type" : "binary",
              "index" : false
            },
            "hosts" : {
              "type" : "keyword"
            },
            "is_default" : {
              "type" : "boolean"
            },
            "name" : {
              "type" : "keyword"
            },
            "type" : {
              "type" : "keyword"
            }
          }
        },
        "ingest_manager_settings" : {
          "properties" : {
            "agent_auto_upgrade" : {
              "type" : "keyword"
            },
            "kibana_ca_sha256" : {
              "type" : "keyword"
            },
            "kibana_url" : {
              "type" : "keyword"
            },
            "package_auto_upgrade" : {
              "type" : "keyword"
            }
          }
        },
        "inventory-view" : {
          "properties" : {
            "accountId" : {
              "type" : "keyword"
            },
            "autoBounds" : {
              "type" : "boolean"
            },
            "autoReload" : {
              "type" : "boolean"
            },
            "boundsOverride" : {
              "properties" : {
                "max" : {
                  "type" : "integer"
                },
                "min" : {
                  "type" : "integer"
                }
              }
            },
            "customMetrics" : {
              "type" : "nested",
              "properties" : {
                "aggregation" : {
                  "type" : "keyword"
                },
                "field" : {
                  "type" : "keyword"
                },
                "id" : {
                  "type" : "keyword"
                },
                "label" : {
                  "type" : "keyword"
                },
                "type" : {
                  "type" : "keyword"
                }
              }
            },
            "customOptions" : {
              "type" : "nested",
              "properties" : {
                "field" : {
                  "type" : "keyword"
                },
                "text" : {
                  "type" : "keyword"
                }
              }
            },
            "filterQuery" : {
              "properties" : {
                "expression" : {
                  "type" : "keyword"
                },
                "kind" : {
                  "type" : "keyword"
                }
              }
            },
            "groupBy" : {
              "type" : "nested",
              "properties" : {
                "field" : {
                  "type" : "keyword"
                },
                "label" : {
                  "type" : "keyword"
                }
              }
            },
            "legend" : {
              "properties" : {
                "palette" : {
                  "type" : "keyword"
                },
                "reverseColors" : {
                  "type" : "boolean"
                },
                "steps" : {
                  "type" : "long"
                }
              }
            },
            "metric" : {
              "properties" : {
                "aggregation" : {
                  "type" : "keyword"
                },
                "field" : {
                  "type" : "keyword"
                },
                "id" : {
                  "type" : "keyword"
                },
                "label" : {
                  "type" : "keyword"
                },
                "type" : {
                  "type" : "keyword"
                }
              }
            },
            "name" : {
              "type" : "keyword"
            },
            "nodeType" : {
              "type" : "keyword"
            },
            "region" : {
              "type" : "keyword"
            },
            "sort" : {
              "properties" : {
                "by" : {
                  "type" : "keyword"
                },
                "direction" : {
                  "type" : "keyword"
                }
              }
            },
            "time" : {
              "type" : "long"
            },
            "view" : {
              "type" : "keyword"
            }
          }
        },
        "kql-telemetry" : {
          "properties" : {
            "optInCount" : {
              "type" : "long"
            },
            "optOutCount" : {
              "type" : "long"
            }
          }
        },
        "lens" : {
          "properties" : {
            "description" : {
              "type" : "text"
            },
            "expression" : {
              "type" : "keyword",
              "index" : false
            },
            "state" : {
              "type" : "flattened"
            },
            "title" : {
              "type" : "text"
            },
            "visualizationType" : {
              "type" : "keyword"
            }
          }
        },
        "lens-ui-telemetry" : {
          "properties" : {
            "count" : {
              "type" : "integer"
            },
            "date" : {
              "type" : "date"
            },
            "name" : {
              "type" : "keyword"
            },
            "type" : {
              "type" : "keyword"
            }
          }
        },
        "map" : {
          "properties" : {
            "bounds" : {
              "type" : "geo_shape"
            },
            "description" : {
              "type" : "text"
            },
            "layerListJSON" : {
              "type" : "text"
            },
            "mapStateJSON" : {
              "type" : "text"
            },
            "title" : {
              "type" : "text"
            },
            "uiStateJSON" : {
              "type" : "text"
            },
            "version" : {
              "type" : "integer"
            }
          }
        },
        "maps-telemetry" : {
          "properties" : {
            "attributesPerMap" : {
              "properties" : {
                "dataSourcesCount" : {
                  "properties" : {
                    "avg" : {
                      "type" : "long"
                    },
                    "max" : {
                      "type" : "long"
                    },
                    "min" : {
                      "type" : "long"
                    }
                  }
                },
                "emsVectorLayersCount" : {
                  "type" : "object",
                  "dynamic" : "true"
                },
                "layerTypesCount" : {
                  "type" : "object",
                  "dynamic" : "true"
                },
                "layersCount" : {
                  "properties" : {
                    "avg" : {
                      "type" : "long"
                    },
                    "max" : {
                      "type" : "long"
                    },
                    "min" : {
                      "type" : "long"
                    }
                  }
                }
              }
            },
            "indexPatternsWithGeoFieldCount" : {
              "type" : "long"
            },
            "indexPatternsWithGeoPointFieldCount" : {
              "type" : "long"
            },
            "indexPatternsWithGeoShapeFieldCount" : {
              "type" : "long"
            },
            "mapsTotalCount" : {
              "type" : "long"
            },
            "settings" : {
              "properties" : {
                "showMapVisualizationTypes" : {
                  "type" : "boolean"
                }
              }
            },
            "timeCaptured" : {
              "type" : "date"
            }
          }
        },
        "metrics-explorer-view" : {
          "properties" : {
            "chartOptions" : {
              "properties" : {
                "stack" : {
                  "type" : "boolean"
                },
                "type" : {
                  "type" : "keyword"
                },
                "yAxisMode" : {
                  "type" : "keyword"
                }
              }
            },
            "currentTimerange" : {
              "properties" : {
                "from" : {
                  "type" : "keyword"
                },
                "interval" : {
                  "type" : "keyword"
                },
                "to" : {
                  "type" : "keyword"
                }
              }
            },
            "name" : {
              "type" : "keyword"
            },
            "options" : {
              "properties" : {
                "aggregation" : {
                  "type" : "keyword"
                },
                "filterQuery" : {
                  "type" : "keyword"
                },
                "forceInterval" : {
                  "type" : "boolean"
                },
                "groupBy" : {
                  "type" : "keyword"
                },
                "limit" : {
                  "type" : "integer"
                },
                "metrics" : {
                  "type" : "nested",
                  "properties" : {
                    "aggregation" : {
                      "type" : "keyword"
                    },
                    "color" : {
                      "type" : "keyword"
                    },
                    "field" : {
                      "type" : "keyword"
                    },
                    "label" : {
                      "type" : "keyword"
                    }
                  }
                }
              }
            }
          }
        },
        "migrationVersion" : {
          "dynamic" : "true",
          "properties" : {
            "config" : {
              "type" : "text",
              "fields" : {
                "keyword" : {
                  "type" : "keyword",
                  "ignore_above" : 256
                }
              }
            },
            "space" : {
              "type" : "text",
              "fields" : {
                "keyword" : {
                  "type" : "keyword",
                  "ignore_above" : 256
                }
              }
            }
          }
        },
        "ml-telemetry" : {
          "properties" : {
            "file_data_visualizer" : {
              "properties" : {
                "index_creation_count" : {
                  "type" : "long"
                }
              }
            }
          }
        },
        "namespace" : {
          "type" : "keyword"
        },
        "namespaces" : {
          "type" : "keyword"
        },
        "query" : {
          "properties" : {
            "description" : {
              "type" : "text"
            },
            "filters" : {
              "type" : "object",
              "enabled" : false
            },
            "query" : {
              "properties" : {
                "language" : {
                  "type" : "keyword"
                },
                "query" : {
                  "type" : "keyword",
                  "index" : false
                }
              }
            },
            "timefilter" : {
              "type" : "object",
              "enabled" : false
            },
            "title" : {
              "type" : "text"
            }
          }
        },
        "references" : {
          "type" : "nested",
          "properties" : {
            "id" : {
              "type" : "keyword"
            },
            "name" : {
              "type" : "keyword"
            },
            "type" : {
              "type" : "keyword"
            }
          }
        },
        "sample-data-telemetry" : {
          "properties" : {
            "installCount" : {
              "type" : "long"
            },
            "unInstallCount" : {
              "type" : "long"
            }
          }
        },
        "search" : {
          "properties" : {
            "columns" : {
              "type" : "keyword"
            },
            "description" : {
              "type" : "text"
            },
            "hits" : {
              "type" : "integer"
            },
            "kibanaSavedObjectMeta" : {
              "properties" : {
                "searchSourceJSON" : {
                  "type" : "text"
                }
              }
            },
            "sort" : {
              "type" : "keyword"
            },
            "title" : {
              "type" : "text"
            },
            "version" : {
              "type" : "integer"
            }
          }
        },
        "siem-detection-engine-rule-actions" : {
          "properties" : {
            "actions" : {
              "properties" : {
                "action_type_id" : {
                  "type" : "keyword"
                },
                "group" : {
                  "type" : "keyword"
                },
                "id" : {
                  "type" : "keyword"
                },
                "params" : {
                  "type" : "object",
                  "enabled" : false
                }
              }
            },
            "alertThrottle" : {
              "type" : "keyword"
            },
            "ruleAlertId" : {
              "type" : "keyword"
            },
            "ruleThrottle" : {
              "type" : "keyword"
            }
          }
        },
        "siem-detection-engine-rule-status" : {
          "properties" : {
            "alertId" : {
              "type" : "keyword"
            },
            "bulkCreateTimeDurations" : {
              "type" : "float"
            },
            "gap" : {
              "type" : "text"
            },
            "lastFailureAt" : {
              "type" : "date"
            },
            "lastFailureMessage" : {
              "type" : "text"
            },
            "lastLookBackDate" : {
              "type" : "date"
            },
            "lastSuccessAt" : {
              "type" : "date"
            },
            "lastSuccessMessage" : {
              "type" : "text"
            },
            "searchAfterTimeDurations" : {
              "type" : "float"
            },
            "status" : {
              "type" : "keyword"
            },
            "statusDate" : {
              "type" : "date"
            }
          }
        },
        "siem-ui-timeline" : {
          "properties" : {
            "columns" : {
              "properties" : {
                "aggregatable" : {
                  "type" : "boolean"
                },
                "category" : {
                  "type" : "keyword"
                },
                "columnHeaderType" : {
                  "type" : "keyword"
                },
                "description" : {
                  "type" : "text"
                },
                "example" : {
                  "type" : "text"
                },
                "id" : {
                  "type" : "keyword"
                },
                "indexes" : {
                  "type" : "keyword"
                },
                "name" : {
                  "type" : "text"
                },
                "placeholder" : {
                  "type" : "text"
                },
                "searchable" : {
                  "type" : "boolean"
                },
                "type" : {
                  "type" : "keyword"
                }
              }
            },
            "created" : {
              "type" : "date"
            },
            "createdBy" : {
              "type" : "text"
            },
            "dataProviders" : {
              "properties" : {
                "and" : {
                  "properties" : {
                    "enabled" : {
                      "type" : "boolean"
                    },
                    "excluded" : {
                      "type" : "boolean"
                    },
                    "id" : {
                      "type" : "keyword"
                    },
                    "kqlQuery" : {
                      "type" : "text"
                    },
                    "name" : {
                      "type" : "text"
                    },
                    "queryMatch" : {
                      "properties" : {
                        "displayField" : {
                          "type" : "text"
                        },
                        "displayValue" : {
                          "type" : "text"
                        },
                        "field" : {
                          "type" : "text"
                        },
                        "operator" : {
                          "type" : "text"
                        },
                        "value" : {
                          "type" : "text"
                        }
                      }
                    }
                  }
                },
                "enabled" : {
                  "type" : "boolean"
                },
                "excluded" : {
                  "type" : "boolean"
                },
                "id" : {
                  "type" : "keyword"
                },
                "kqlQuery" : {
                  "type" : "text"
                },
                "name" : {
                  "type" : "text"
                },
                "queryMatch" : {
                  "properties" : {
                    "displayField" : {
                      "type" : "text"
                    },
                    "displayValue" : {
                      "type" : "text"
                    },
                    "field" : {
                      "type" : "text"
                    },
                    "operator" : {
                      "type" : "text"
                    },
                    "value" : {
                      "type" : "text"
                    }
                  }
                }
              }
            },
            "dateRange" : {
              "properties" : {
                "end" : {
                  "type" : "date"
                },
                "start" : {
                  "type" : "date"
                }
              }
            },
            "description" : {
              "type" : "text"
            },
            "eventType" : {
              "type" : "keyword"
            },
            "favorite" : {
              "properties" : {
                "favoriteDate" : {
                  "type" : "date"
                },
                "fullName" : {
                  "type" : "text"
                },
                "keySearch" : {
                  "type" : "text"
                },
                "userName" : {
                  "type" : "text"
                }
              }
            },
            "filters" : {
              "properties" : {
                "exists" : {
                  "type" : "text"
                },
                "match_all" : {
                  "type" : "text"
                },
                "meta" : {
                  "properties" : {
                    "alias" : {
                      "type" : "text"
                    },
                    "controlledBy" : {
                      "type" : "text"
                    },
                    "disabled" : {
                      "type" : "boolean"
                    },
                    "field" : {
                      "type" : "text"
                    },
                    "formattedValue" : {
                      "type" : "text"
                    },
                    "index" : {
                      "type" : "keyword"
                    },
                    "key" : {
                      "type" : "keyword"
                    },
                    "negate" : {
                      "type" : "boolean"
                    },
                    "params" : {
                      "type" : "text"
                    },
                    "type" : {
                      "type" : "keyword"
                    },
                    "value" : {
                      "type" : "text"
                    }
                  }
                },
                "missing" : {
                  "type" : "text"
                },
                "query" : {
                  "type" : "text"
                },
                "range" : {
                  "type" : "text"
                },
                "script" : {
                  "type" : "text"
                }
              }
            },
            "kqlMode" : {
              "type" : "keyword"
            },
            "kqlQuery" : {
              "properties" : {
                "filterQuery" : {
                  "properties" : {
                    "kuery" : {
                      "properties" : {
                        "expression" : {
                          "type" : "text"
                        },
                        "kind" : {
                          "type" : "keyword"
                        }
                      }
                    },
                    "serializedQuery" : {
                      "type" : "text"
                    }
                  }
                }
              }
            },
            "savedQueryId" : {
              "type" : "keyword"
            },
            "sort" : {
              "properties" : {
                "columnId" : {
                  "type" : "keyword"
                },
                "sortDirection" : {
                  "type" : "keyword"
                }
              }
            },
            "status" : {
              "type" : "keyword"
            },
            "templateTimelineId" : {
              "type" : "text"
            },
            "templateTimelineVersion" : {
              "type" : "integer"
            },
            "timelineType" : {
              "type" : "keyword"
            },
            "title" : {
              "type" : "text"
            },
            "updated" : {
              "type" : "date"
            },
            "updatedBy" : {
              "type" : "text"
            }
          }
        },
        "siem-ui-timeline-note" : {
          "properties" : {
            "created" : {
              "type" : "date"
            },
            "createdBy" : {
              "type" : "text"
            },
            "eventId" : {
              "type" : "keyword"
            },
            "note" : {
              "type" : "text"
            },
            "timelineId" : {
              "type" : "keyword"
            },
            "updated" : {
              "type" : "date"
            },
            "updatedBy" : {
              "type" : "text"
            }
          }
        },
        "siem-ui-timeline-pinned-event" : {
          "properties" : {
            "created" : {
              "type" : "date"
            },
            "createdBy" : {
              "type" : "text"
            },
            "eventId" : {
              "type" : "keyword"
            },
            "timelineId" : {
              "type" : "keyword"
            },
            "updated" : {
              "type" : "date"
            },
            "updatedBy" : {
              "type" : "text"
            }
          }
        },
        "space" : {
          "properties" : {
            "_reserved" : {
              "type" : "boolean"
            },
            "color" : {
              "type" : "keyword"
            },
            "description" : {
              "type" : "text"
            },
            "disabledFeatures" : {
              "type" : "keyword"
            },
            "imageUrl" : {
              "type" : "text",
              "index" : false
            },
            "initials" : {
              "type" : "keyword"
            },
            "name" : {
              "type" : "text",
              "fields" : {
                "keyword" : {
                  "type" : "keyword",
                  "ignore_above" : 2048
                }
              }
            }
          }
        },
        "telemetry" : {
          "properties" : {
            "allowChangingOptInStatus" : {
              "type" : "boolean"
            },
            "enabled" : {
              "type" : "boolean"
            },
            "lastReported" : {
              "type" : "date"
            },
            "lastVersionChecked" : {
              "type" : "keyword"
            },
            "reportFailureCount" : {
              "type" : "integer"
            },
            "reportFailureVersion" : {
              "type" : "keyword"
            },
            "sendUsageFrom" : {
              "type" : "keyword"
            },
            "userHasSeenNotice" : {
              "type" : "boolean"
            }
          }
        },
        "timelion-sheet" : {
          "properties" : {
            "description" : {
              "type" : "text"
            },
            "hits" : {
              "type" : "integer"
            },
            "kibanaSavedObjectMeta" : {
              "properties" : {
                "searchSourceJSON" : {
                  "type" : "text"
                }
              }
            },
            "timelion_chart_height" : {
              "type" : "integer"
            },
            "timelion_columns" : {
              "type" : "integer"
            },
            "timelion_interval" : {
              "type" : "keyword"
            },
            "timelion_other_interval" : {
              "type" : "keyword"
            },
            "timelion_rows" : {
              "type" : "integer"
            },
            "timelion_sheet" : {
              "type" : "text"
            },
            "title" : {
              "type" : "text"
            },
            "version" : {
              "type" : "integer"
            }
          }
        },
        "tsvb-validation-telemetry" : {
          "properties" : {
            "failedRequests" : {
              "type" : "long"
            }
          }
        },
        "type" : {
          "type" : "keyword"
        },
        "ui-metric" : {
          "properties" : {
            "count" : {
              "type" : "integer"
            }
          }
        },
        "updated_at" : {
          "type" : "date"
        },
        "upgrade-assistant-reindex-operation" : {
          "properties" : {
            "errorMessage" : {
              "type" : "keyword"
            },
            "indexName" : {
              "type" : "keyword"
            },
            "lastCompletedStep" : {
              "type" : "integer"
            },
            "locked" : {
              "type" : "date"
            },
            "newIndexName" : {
              "type" : "keyword"
            },
            "reindexOptions" : {
              "properties" : {
                "openAndClose" : {
                  "type" : "boolean"
                },
                "queueSettings" : {
                  "properties" : {
                    "queuedAt" : {
                      "type" : "long"
                    },
                    "startedAt" : {
                      "type" : "long"
                    }
                  }
                }
              }
            },
            "reindexTaskId" : {
              "type" : "keyword"
            },
            "reindexTaskPercComplete" : {
              "type" : "float"
            },
            "runningReindexCount" : {
              "type" : "integer"
            },
            "status" : {
              "type" : "integer"
            }
          }
        },
        "upgrade-assistant-telemetry" : {
          "properties" : {
            "features" : {
              "properties" : {
                "deprecation_logging" : {
                  "properties" : {
                    "enabled" : {
                      "type" : "boolean",
                      "null_value" : true
                    }
                  }
                }
              }
            },
            "ui_open" : {
              "properties" : {
                "cluster" : {
                  "type" : "long",
                  "null_value" : 0
                },
                "indices" : {
                  "type" : "long",
                  "null_value" : 0
                },
                "overview" : {
                  "type" : "long",
                  "null_value" : 0
                }
              }
            },
            "ui_reindex" : {
              "properties" : {
                "close" : {
                  "type" : "long",
                  "null_value" : 0
                },
                "open" : {
                  "type" : "long",
                  "null_value" : 0
                },
                "start" : {
                  "type" : "long",
                  "null_value" : 0
                },
                "stop" : {
                  "type" : "long",
                  "null_value" : 0
                }
              }
            }
          }
        },
        "uptime-dynamic-settings" : {
          "properties" : {
            "certAgeThreshold" : {
              "type" : "long"
            },
            "certExpirationThreshold" : {
              "type" : "long"
            },
            "heartbeatIndices" : {
              "type" : "keyword"
            }
          }
        },
        "url" : {
          "properties" : {
            "accessCount" : {
              "type" : "long"
            },
            "accessDate" : {
              "type" : "date"
            },
            "createDate" : {
              "type" : "date"
            },
            "url" : {
              "type" : "text",
              "fields" : {
                "keyword" : {
                  "type" : "keyword"
                }
              }
            }
          }
        },
        "visualization" : {
          "properties" : {
            "description" : {
              "type" : "text"
            },
            "kibanaSavedObjectMeta" : {
              "properties" : {
                "searchSourceJSON" : {
                  "type" : "text"
                }
              }
            },
            "savedSearchRefName" : {
              "type" : "keyword"
            },
            "title" : {
              "type" : "text"
            },
            "uiStateJSON" : {
              "type" : "text"
            },
            "version" : {
              "type" : "integer"
            },
            "visState" : {
              "type" : "text"
            }
          }
        }
      }
    }
}

@@ -917,7 +917,8 @@ protected boolean docValuesByDefault() {
@Override
protected void doXContentBody(XContentBuilder builder, boolean includeDefaults, Params params) throws IOException {
super.doXContentBody(builder, includeDefaults, params);
if (includeDefaults || (mappedFieldType.isSearchable() && fieldType.indexOptions() != Defaults.FIELD_TYPE.indexOptions())) {
if (fieldType.indexOptions() != IndexOptions.NONE
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so we don't want to print out index_options: none ? sorry I don't recall what we were doing before the refactoring.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, if index is set to false then we don't emit the index_options. The pre-existing method that converts the lucene IndexOptions enum to a string doesn' accept IndexOptions.NONE

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for explaining, makes sense

@romseygeek
Copy link
Contributor Author

I had omitted to explicitly test the index option in the base FieldMapperTestCase - I've now added this test in, and fixed a couple of other places where this was either throwing an error or incorrectly allowing merges.

@romseygeek
Copy link
Contributor Author

@elasticmachine update branch

Copy link
Member

@javanna javanna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -635,7 +635,8 @@ protected void parseCreateField(ParseContext context) throws IOException {
@Override
protected void doXContentBody(XContentBuilder builder, boolean includeDefaults, Params params) throws IOException {
super.doXContentBody(builder, includeDefaults, params);
if (includeDefaults || mappedFieldType.isSearchable() && fieldType.indexOptions() != Defaults.FIELD_TYPE.indexOptions()) {
if (fieldType.indexOptions() != IndexOptions.NONE
&& (includeDefaults || fieldType.indexOptions() != Defaults.FIELD_TYPE.indexOptions())) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this logic is now duplicated in multiple places, I am tempted to ask if we can share it, on the other hand I am afraid it may complicate things and removing this duplication is not a priority at the moment.

@romseygeek romseygeek merged commit 708f6bf into elastic:master Jun 18, 2020
@romseygeek romseygeek deleted the bug/mapping-404 branch June 18, 2020 13:34
romseygeek added a commit to romseygeek/elasticsearch that referenced this pull request Jun 18, 2020
…lastic#58235)

Fixes a bug in TextFieldMapper serialization when index is false, and adds a
base-class test to ensure that all field mappers are tested against all variations
with defaults both included and excluded.

Fixes elastic#58188
romseygeek added a commit that referenced this pull request Jun 18, 2020
…58235) (#58328)

Fixes a bug in TextFieldMapper serialization when index is false, and adds a
base-class test to ensure that all field mappers are tested against all variations
with defaults both included and excluded.

Fixes #58188
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>non-issue :Search Foundations/Mapping Index mappings, including merging and defining field types Team:Search Meta label for search team v7.9.0 v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Field mapping API unexpectedly returns 404 response
5 participants