ankane/searchkick

Request level options for update requests

lizzzp1 opened this issue · 2 comments

Is your feature request related to a problem? Please describe.
Yes, I currently have a partial reindex set up as async on my model. My problem is that by doing a partial reindex, I now see various errors in my logs. version_conflict_engine_exception document_missing_exception.

Describe the solution you'd like
A clear and concise description of your idea.
Basically I'd like an additional option to enable request level options such as model.reindex(:search_data_partial, mode: :async, retry_on_conflict: 5) That way update in the body would include this on the request. I think it'd help my issue. I'm not seeing another way to pass this for a request.

Also thank you for this awesome gem! Works so great for us.

What I'm going to do is something like

  def reindex_model
    if Searchkick.client.exists?(index: name, id: id)
      reindex(:search_data_partial, mode: :async)
    end
  end

but would be cool to have the option for an upsert in the body.