studioespresso / craft-scout

Craft Scout provides a simple solution for adding full-text search to your entries. Scout will automatically keep your search indexes in sync with your entries.
MIT License
81 stars 54 forks source link

Potential for Multiple Application IDs? #294

Open rgbjay opened 7 months ago

rgbjay commented 7 months ago

We have a use case where we ideally need to be able to send data to two Applications within our Algolia account.

They are both part of a multisite but are managed by different teams and operationally it would be much cleaner to setup two applications rather than two indices inside one application.

Is there a) a way to do this already (I suspect the answer is no) or b) plans to add this functionality in, i.e. changing the application_id config setting (and associated API key fields) to accept an array rather than a string perhaps?

Any info would be helpful.

janhenckens commented 7 months ago

@rgbjay Would the applications split per site? Application A for site A, application B for site B?

I think we could add support for multi-site style config where you can group settings per siteHandle - if that's how things are structured on your end.

JamesNock commented 7 months ago

@janhenckens I was about to ask the same question as the OP. I have a use-case where we could definitely use a different application id on a per-site basis. If we could get that functionality then it would be absolutely magical!

janhenckens commented 7 months ago

Yeah, that should be quite easy to do. Which version of Craft & Scout are you running at the moment @JamesNock? (just to be sure I merge it for the right version)

JamesNock commented 7 months ago

Amazing! CraftCMS 4.7.4 Pro with Scout 3.2.2 at present. Thank you @janhenckens

janhenckens commented 7 months ago

Ok, will try to have a look over the weekend.

Might not be as easy as expected, since the function Craft uses to localise config (ConfigHelper::localizedValue()) relies an the currentSite (in web requests), but Scout usually needs these in the CP or in the Queue.

Will keep you posted on my progress!

jamiewade commented 7 months ago

Thanks @janhenckens! I too would be interested in this feature. Please keep us updated on the progress!

rgbjay commented 5 months ago

Apologies for going AWOL on this - still very much a feature we would like!