algoliasearch-rails icon indicating copy to clipboard operation
algoliasearch-rails copied to clipboard

Settings for add_slave inside add_index

Open robertjwhitney opened this issue 8 years ago • 7 comments

Hi just a sanity check, in the DSL, it looks like when I add_slave inside of an add_index block, all the settings are ignored.

robertjwhitney avatar Jan 24 '17 17:01 robertjwhitney

Just digging around a little bit, should something be done with the block here? https://github.com/algolia/algoliasearch-rails/blob/2d63c37ed6151e314e5479e6a102d1f48e23cd4f/lib/algoliasearch-rails.rb#L246

robertjwhitney avatar Jan 24 '17 18:01 robertjwhitney

I did a little more digging yesterday, seems like the settings for the slaves of added indexes never get applied when they're all getting looped through... will have to do some more source diving to track down where that might need to change.

robertjwhitney avatar Jan 25 '17 16:01 robertjwhitney

Hi just a sanity check, in the DSL, it looks like when I add_slave inside of an add_index block, all the settings are ignored.

Arg indeed, I don't think this is supported :/ We should patch the DSL to forbid it.

Does it mean you're targeting several indices (with slaves) from a single model @robertjwhitney ?

redox avatar Jan 30 '17 09:01 redox

@redox yep exactly. I need to right now for legacy support on some clients, but would like to migrate away eventually.

robertjwhitney avatar Jan 30 '17 15:01 robertjwhitney

Is there a good way we could add support? Seems like a pretty valid use-case?

robertjwhitney avatar Jan 30 '17 15:01 robertjwhitney

Is there a good way we could add support? Seems like a pretty valid use-case?

I need to check whether this has a big impact or not; the current replica handling is a bit messy and would eventually need to a full rewrite (gem was designed when replicas were not introduced yet).

I'm not confident providing any ETA; and I would recommend going for custom ruby code to set the settings & use the index.

redox avatar Jan 30 '17 16:01 redox

Cool, well, I'm happy to help it along if you come up with a plan for doing that. Replica's are a pretty important feature, and we'd love to have full support!

robertjwhitney avatar Feb 01 '17 17:02 robertjwhitney