Comments (5)
Thank you for explanation! Now everything clear!
from algoliasearch-client-ruby.
Hi @USvER
You can simply store the returned client in a variable, and call this method multiple times:
client_one = Algolia.init(application_id: 'APP_ID_1', api_key: 'API_KEY')
client_two = Algolia.init(application_id: 'APP_ID_2', api_key: 'API_KEY')
Enjoy
from algoliasearch-client-ruby.
Thanks! I was under impression that .init
stores application_id
and api_key
in global variables and will interfere each other.
from algoliasearch-client-ruby.
Indeed, for backward compatibility, we kept it. Each time you call .init
, it keeps the last client as a singleton. If you use Algolia.methods
, it will use the most recent instantiated client. But we don't recommend to use these methods. Instead, we've implemented them inside each Client and Index class as well, and we encourage you to use these!
from algoliasearch-client-ruby.
Hi @USvER
You can simply store the returned client in a variable, and call this method multiple times:
client_one = Algolia.init(application_id: 'APP_ID_1', api_key: 'API_KEY') client_two = Algolia.init(application_id: 'APP_ID_2', api_key: 'API_KEY')
Enjoy
algoliasearch-rails
) you will need to call the Algolia.init
method once again with your standard parameters, else you will end up with the latest Algolia application as the default.
Here is what we ended up doing:
client_one = Algolia.init(application_id: 'APP_ID_1', api_key: 'API_KEY')
client_two = Algolia.init(application_id: 'APP_ID_2', api_key: 'API_KEY')
Algolia.init(
application_id: AlgoliaSearch.configuration[:application_id],
api_key: AlgoliaSearch.configuration[:api_key]
)
But it's clearly not ideal. I hope the algoliasearch-rails
gem will support multiple Algolia apps in the future.
from algoliasearch-client-ruby.
Related Issues (20)
- Add API key dealer to CI
- feat: payload for Redirect rule in the search response HOT 1
- Rename `replaceExistingSynonyms` to `clearExistingSynonyms` HOT 1
- feat(rules): Client side information consequence in rules HOT 1
- feat(virtual indices): Virtual indices related parameters HOT 1
- index.set_settings => { forwardToReplicas: true } as options raises an error
- Update Contributing guide
- Making read-only request breaks subsequent write requests HOT 6
- Rename Recommendation API to Personalization API HOT 1
- visa
- `#multiple_queries` does not accept a params Hash as documented HOT 1
- Regarding the Log "Too many indices, please remove unused indices before pushing"
- `get_objects` fails when passing in `attributesToRetrieve` HOT 1
- `#partial_update_objects` fails to accept options HOT 3
- Dependency Dashboard
- `#multiple_queries` raises NoMethodError if params are omitted HOT 1
- Version 2.3.0 causing "Algolia::AlgoliaUnreachableHostError: Unreachable hosts" HOT 6
- `Helpers` module is in global namespace
- Specific tmp index.
- Timeouts not being passed to http_requester HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from algoliasearch-client-ruby.