0
votes

I am migrating from Elasticsearch v2.1 to v6.1.1 and in v2.1 my mappings for dob which worked fine now throws an error.

dob: {
          type: 'date',
          format: 'strict_date_optional_time||epoch_millis',
          term_vector: 'yes',
          analyzer: 'ngram_analyzer',
          search_analyzer: 'standard',
          copy_to: '_all'
        }

I now get the following error:

"error":{"root_cause":[{"type":"mapper_parsing_exception","reason":"Mapping definition for [dob] has unsupported parameters: [search_analyzer : standard] [analyzer : ngram_analyzer] [term_vector : yes]"}],"type":"mapper_parsing_exception"

There seems to be an overall problem with date types getting analyzers now. Why is this and how can I solve this problem? Thanks!

1

1 Answers

1
votes

As far as I know, these settings have never been supported for date fields. What I suggest you do is to create a text sub-field in your dob field so that you can continue to use your analyzers.

  dob: {
      type: 'date',
      format: 'strict_date_optional_time||epoch_millis',
      fields: {
          text: {
             type: 'text',
             term_vector: 'yes',
             analyzer: 'ngram_analyzer',
             search_analyzer: 'standard',
             copy_to: '_all'
          }
      }
  }