Skip to content
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

Is there a way to define dynamic templates in the schema? #272

Closed
valearna opened this issue Mar 24, 2022 · 2 comments
Closed

Is there a way to define dynamic templates in the schema? #272

valearna opened this issue Mar 24, 2022 · 2 comments

Comments

@valearna
Copy link

I'd like to add dynamic templates to my index mappings, as described in the elasticsearch official guide: https://www.elastic.co/guide/en/elasticsearch/reference/7.10/dynamic-templates.html

Is there a way to define overall mappings properties in the pgsync schema?

@valearna
Copy link
Author

valearna commented Mar 25, 2022

I tried setting the "mapping" field in the schema as follows:

"mapping": {
    "dynamic_templates": [
      {
        "integers": {
          "match_mapping_type": "long",
          "mapping": {
            "type": "integer"
          }
        }
      },
      {
        "strings": {
          "match_mapping_type": "string",
          "mapping": {
            "type": "text",
            "fields": {
              "raw": {
                "type":  "keyword",
                "ignore_above": 256
              }
            }
          }
        }
      }
    ]
  }

but got this error:

elasticsearch.exceptions.RequestError: RequestError(400, 'mapper_parsing_exception', 'Expected map for property [fields] on field [dynamic_templates] but got a class java.lang.String')

@toluaina
Copy link
Owner

this should be working now in the master branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants