Skip to content

Working with Elasticsearch Mappings #44

@eric-kolotyluk

Description

@eric-kolotyluk

I apologize if this is not the appropriate forum for these questions, so please direct me to the appropriate place if necessary...

We are in the process of adopting JSON Schema, and we are heavy users of Elasticsearch. One of the ideas we are considering is using JSON Schema to define our entities in Elasticsearch in such as way that we can automatically generate the Elasticsearch Mapping from the JSON Schema, such that JSON Schema is always (as much as possible) our core schema mechanism.

Would it be appropriate to use different dialects and vocabularies that define keywords and such in support of guiding the Elasticsearch Mapping generation. For example, by default we generally want to define 'keyword' data instead of the default 'text' data; but in some cases we might want to override the defaults in our JSON Schema with an 'elasticsearch' keyword, for example

  "properties": {
    "explanation": {
      "description": "a natural language explanation/justification",
      "type": "string",
      "elasticsearch": {
        "fieldDataType": "text",
        "$comment": "override 'keyword' default"
      }
    }
  }

Am I making sense, or out to lunch? Am I understanding the intent of JSON Schema Vocabularies?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions