Problem/Motivation
This module is hardcoded to only create the _schema_analysis_synonyms_english.json, from synonyms in whichever language is chosen in the drush command drush solr-search-synonym:export --plugin=solr_uploader --langcode=[INSERT_LANGCODE].
You can instances of $path = 'schema/analysis/synonyms/english'; in /src/Plugin/solr_search_synonym/export/SolrUploader.php and in /src/Controller/SolrSynonymUploaderBatchExport.php
Steps to reproduce
- Enable and configure the module in a multilingual site.
- Add synonyms in another language than English
drush solr-search-synonym:export --plugin=solr --langcode=[YOUR_CHOSEN_LANGCODE]drush solr-search-synonym:export --plugin=solr_uploader --langcode=[YOUR_CHOSEN_LANGCODE]
The result is a _schema_analysis_synonyms_english.json files you can witness here: admin/config/search/search-api/server/[SERVER]/files with in it synonyms of your chose language, that only have an effect in an english site search.
Proposed resolution
On every drush solr-search-synonym:export --plugin=solr_uploader --langcode=[YOUR_CHOSEN_LANGCODE], we need to replace the hardcoded path variable $path = 'schema/analysis/synonyms/english'; by the path for the corresponding language. Or we need to just remove the language from the drush command and upload all synonyms to their correct language solr config file.
Remaining tasks
Create a partch / merge request.
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | Screenshot from 2023-12-06 14-56-10.png | 73.03 KB | bhojwanipankaj05 |
Comments
Comment #2
bhojwanipankaj05 commentedHi @stijndmd,
Thank you for investigating this. I am checking the case and will resolve this as earliest possible.
Comment #3
bhojwanipankaj05 commentedSynonyms Multilingual support implemented with the new release 2.0.2
Comment #4
stijndmd commentedwill review this tomorrow
Comment #5
stijndmd commentedI'm confused as to why we have to pick one langauage for the managed resource mapping in configuration.
What's needed is the possibility to map the resources via drush for all the languages on the website.
Comment #6
bhojwanipankaj05 commented@stijndmd If we are importing synonyms using drush command like - drush solr-search-synonym:export --plugin=solr_uploader --langcode=[YOUR_CHOSEN_LANGCODE]
here we can just pass langcode, its not related with configured language in admin synonyms setting. language configuration works with Import to Solr button in the admin synonyms listing page, where we need to change the language before importing data using Import to Solr button for a specific language.
Comment #7
bhojwanipankaj05 commentedComment #8
joseph.olstadFor some reason it's pushing out an unrecognized parameter, perhaps instead of français the endpoint is expecting french?
Comment #9
joseph.olstadok I hard coded it to 'french' , similar error. I'm not sure what is going on. Support request to acquia likely.
Comment #10
joseph.olstadassuming this is fixed and it's just me
Comment #11
bhojwanipankaj05 commented@josepholstad As it shows No REST managed resource registered for français and french path. You just need to register resource by adding this below line with POST or PUT method in postman or any other API management platform.
{"class":"org.apache.solr.rest.schema.analysis.ManagedSynonymFilterFactory$SynonymManager"}
Reference screenshot attached. Please check
After registering resource you can follow the synonym export command.
Comment #12
bhojwanipankaj05 commented