Restricting index to only a subset of Data

I have tried to index only a subset of data using the instructions here https://github.com/algolia/algoliasearch-rails

However; when I update an attribute other than email, I still receive a deleteObject getting called by algolia. I cannot seem to bypass this.

    algoliasearch if: :email, index_name: ENV["ALGOLIA_CUSTOMER_INDEX"] do
    attributes :email, :status
    add_attribute :first_name
    add_attribute :last_name
    add_attribute :class_name
    add_attribute :class_id
    add_attribute :class_location
    searchableAttributes ['email', 'first_name', 'last_name', 'class_location']
  end

  def email_changed?
    self.email_previously_changed?
  end

Hi Isaah,

I’ve responded to your other message via the documentation feedback form, but just in case I’ll respond here as well :slight_smile:

Can you give me an example of object, and updates to that object that trigger the deleteObject? Are other requests also triggered? Thanks.

Cheers