0

I'm digging into Tire gem documentation. I need some way to search against another elastic instance or create index on another elastic instance. Don't ask me why - it's architecture problem.

We can define some basic settings within block:

Tire.configure do
  url 'http://localhost:9200/'
end

What should I do to run some command against another instance The first idea is create subclass and redefine url, but it's sounds bad for me. Does anybody know clean way to do thats.

Volodymyr
  • 1,136
  • 3
  • 11
  • 28

1 Answers1

1

Unfortunately, Tire does not allow to connect to another cluster in the same Ruby process. That is a sad consequence of the design and will be fixed in future versions of the client.

Your options here, depending on what capabilities you need, are:

1/ Use a different process for connecting to the other cluster, use something like Redis to implement publish/subscribe communication between the processes.

2/ Use a different Ruby client.

3/ Use Tire::Configuration.client with a different URL.

karmi
  • 14,059
  • 3
  • 33
  • 41