elastic / elasticsearch-rails

Elasticsearch integrations for ActiveModel/Record and Ruby on Rails
Apache License 2.0
3.07k stars 792 forks source link

specify an alias near the index_name in an AR model #1045

Open sr-akhil opened 1 year ago

sr-akhil commented 1 year ago

I wanted to now whether it is possible to specify an alias near the index_name in an AR model so that the url the is getting hit can be made dynamic.

I am trying to use this gem for multi-tenant application which is currently using mySQL db with every tenant having his own db. So it would be helpful if any feature as the following is available so that the request URL used for PUT request become dynamic

E.g.

index_name 'test'
alias tenant_name

will result in the following request PUT test/_alias/tenant_name

using which it will be possible to configure required job at the Elasticsearch side

Thanks

sr-akhil commented 1 year ago

If it will help anyone