-
Notifications
You must be signed in to change notification settings - Fork 74
Description
- Symfony version: 4.4.5
- Algolia Search Bundle version: 4.1.0
- Algolia Client Version: 2.5.1
- Language Version: 7.4.1
Description
The current documentation about the integration of the search bundle is missing how to handle replicas the right way.
I was able to sort some steps out and bypass the issue which is mentioned in: #269.
My target is to provide an index with multiple replicas and distinct sort configurations, aside from that it must me possible to export all index settings and apply them during an application deployment.
1. Backup and restore index configurations using the cli search:settings:backup:
- if an index is listet in the algolia_search.yaml it's configuration will be exported as expected, including the information about it's replicas
- the configuration from the replicas itself are not exported this way
To also export the configurations of the replicas, it is required to list them all one by one in the algolia_search.yaml as seen down in the section "Steps To Reproduce".
2. Import data into an index using the cli search:import:
- if the index and it's replicas are configured in the algolia_search.yaml, an import will lead to an exception during the unwanted push to a replica instead to the master:
In ApiWrapper.php line 210:
cannot apply a add object request on a replica index
To bybass this issue it is required to provide the --indices option with the name of the master index. It is also required that the master index has to be the last which is configured in the algolia_search.yaml. This is the mentioned bypass for the issue: #269.
Steps To Reproduce
Example algolia_search.yaml to show how it is currently possible to use replicas with the search bundle.
algolia_search:
prefix: ""
doctrineSubscribedEvents: []
indices:
- name: index_property_asc
class: Vendor\Orm\Entity\IndexEntity
- name: index_property_desc
class: Vendor\Orm\Entity\IndexEntity
- name: index
class: Vendor\Orm\Entity\IndexEntity
Summary
I would really like to see additional informations about this in the official documentation on how to do it the right way.
Also i would really appreciate further improvements in the search bundle to either be able to avoid the requirement to configure each replica or to be able to provide a specific configuration for them and also a proper handling for replicas in the cli to avoid unwanted exceptions during import.