Skip to content

Incomplete index in Callback #5

@samqiu

Description

@samqiu

Hi @karmi ,

Thank you for your awesome gems!

I am replacing Tire to elasticsearch-rails, the first issue is that it won't perform as_indexed_json when update_document, It' s update changed_attributes only.

Is there any solution about this? perform as_indexed_json when update_document, not only changed_attributes .

Source

https://github.com/elasticsearch/elasticsearch-rails/blob/master/elasticsearch-model/lib/elasticsearch/model/indexing.rb#L334

Model

class User << ActiveRecord::Base

  has_many :keywords

  def as_indexed_json(options={})
    { :id => id, 
      email: email,
      first_name: first_name, 
      last_name: last_name,

      full_name: "#{first_name} #{last_name}",
      research_interests: keywords.map(&:name)
    }
  end

end

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