Solr provides a Managed Synonym Graph Filter for managing synonyms using the REST API (in this example, through the endpoint /solr/collection_name/schema/analysis/synonyms/english ):
<analyzer type="index"> <tokenizer class="solr.StandardTokenizerFactory"/> <filter class="solr.ManagedSynonymGraphFilterFactory" managed="english"/> <filter class="solr.FlattenGraphFilterFactory"/> </analyzer> <analyzer type="query"> <tokenizer class="solr.StandardTokenizerFactory"/> <filter class="solr.ManagedSynonymGraphFilterFactory" managed="english"/> </analyzer>
To use synonyms, a kernel reboot is required. Solr provides a REST API for this as well. CoreAdmin admin/cores?action=RELOAD&core=core-name API Update
The RELOAD action loads the new kernel from the configuration of the existing registered Solr kernel. While the new kernel is initializing, the existing one will continue to process requests. When the new Solr core is ready, it takes over and the old core is unloaded.
source share