Supplejack API v3.6.14 Release Notes

Release Date: 2020-11-03 // over 3 years ago
  • โšก๏ธ Update the way that records get indexed and remove old implementation. Records now store their index_updated and index_updated_at flags and are intended on being processed by the provided index_processor to be indexed. This removes the complexity of the queue and the reliance on Sidekiq for indexing.

    ๐Ÿ”„ Changes required to get your indexing to work again:

    โž• Add these fields to your RecordSchema:

      model_field :index_updated, field_options: { type: Boolean }, index_fields: { index_updated: 1 }
      model_field :index_updated_at, field_options: { type: DateTime }, index_fields: { index_updated_at: 1 }
    

    โšก๏ธ Build an index for the index_updated field in your Mongo Database:

    db.records.createIndex({ index_updated: 1 }, { background: true })
    

    ๐Ÿ’Ž Then run the rake task that comes with the SJ Engine as a long running ruby process:

    bundle exec rake index_processor:run[1000]
    

    ๐Ÿ‘ท Note that this process is intended on running all the time, it is not a cronjob or a one off job. You can just start it up and leave it running. If you are not running on Kubernetes you should have something in place to restart it if it dies.

    ๐Ÿ†“ If you run into trouble, feel free to open an issue and we will get back to you as soon as we can.