toptal / chewy

High-level Elasticsearch Ruby framework based on the official elasticsearch-ruby client
MIT License
1.88k stars 364 forks source link

How to migrate to chewy 7.2 #929

Open lyb124553153 opened 6 months ago

lyb124553153 commented 6 months ago

befor chewy 7.2, I have some code like this

class MessagesIndex < Chewy::Index
   [Post, Form, TemplatePost].each do |klass|
   define_type klass do
      field :id, type: 'integer'
      field :title, type: 'string', analyzer: 'ik_max_word'
   end
end

I can define mulityplie type in a single class, But After '7.2', 'define_type' was removed, How could I add multyply index for messages class I keep getting this error Chewy::UndefinedIndex: Can not find index named `Messages#formIndex

lyb124553153 commented 6 months ago

Is there a way to create Index name likse Messages#formIndex ?