Elasticsearch : Root mapping definition has unsupported parameters index : not_analyzed

后端 未结 5 1176
一生所求
一生所求 2020-12-23 11:17

Hi all I am trying to create schema Test.

PUT /test
{
    \"mappings\": {
        \"field1\": {
            \"type\": \"integer\"
        },
        \"field         


        
5条回答
  •  感情败类
    2020-12-23 11:36

    As of ES 7, mapping types have been removed. You can read more details here

    If you are using Ruby On Rails this means that you may need to remove document_type from your model or concern.

    As an alternative to mapping types one solution is to use an index per document type.

    Before:

    module Searchable
      extend ActiveSupport::Concern
    
      included do
        include Elasticsearch::Model
        include Elasticsearch::Model::Callbacks
        index_name [Rails.env, Rails.application.class.module_parent_name.underscore].join('_')
        document_type self.name.downcase
      end
    end
    

    After:

    module Searchable
      extend ActiveSupport::Concern
    
      included do
        include Elasticsearch::Model
        include Elasticsearch::Model::Callbacks
        index_name [Rails.env, Rails.application.class.module_parent_name.underscore, self.name.downcase].join('_')
      end
    end
    

提交回复
热议问题