Home Searchkick async updating
Reply: 0

Searchkick async updating

user1144 Published in March 23, 2018, 6:54 am

I started to use searchkick for connecting with elasticsearch, and I encountered a problem with index updating in background job. I did all by example in documentation, but searchkick tasks in sidekiq only accumulated and executed only after restarting sidekiq, and after execution, tasks collect again without execution. Below code.

Here my searchkick.rb initializer

Searchkick.client =
    url: 'remote_ip:9200',
    retry_on_failure: true,
    transport_options: { request: { timeout: 250 } }

Searchkick.redis = ConnectionPool.new { Redis.new }

part of my model

after_commit  :searchkick_indexing

searchkick callbacks: :queue, index_name: :my_index_name

def search_data
    title: title,
    description: description


def searchkick_indexing
  Searchkick::ProcessQueueJob.perform_later(class_name: "model_name")

And, also, I added searchkick queue to sidekiq.yml. How to performing searchkick job always without restarting sidekiq? Thank in advance?

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.303072 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO