Reload managed synonyms in Solr

355 Views Asked by At

I am using Solr 8.6.1, started in solrcloud mode. The field type is

{
          "add-field-type" : {
              "name":"articleTitle",
              "positionIncrementGap":100,
              "multiValued":false,
              "class":"solr.TextField",
              "indexAnalyzer":{
                  "tokenizer":{ "class":"solr.StandardTokenizerFactory" },
                  "filters":[
                      { "class":"solr.LowerCaseFilterFactory" },
                      { "class":"solr.ManagedStopFilterFactory", "managed":"english" },
                      { "class":"solr.ManagedSynonymGraphFilterFactory", "managed":"english" },
                      { "class":"solr.FlattenGraphFilterFactory" },
                      { "class":"solr.PorterStemFilterFactory" }
                  ]
              },
              "queryAnalyzer":{
                  "tokenizer":{ "class":"solr.StandardTokenizerFactory" },
                  "filters":[
                      { "class":"solr.LowerCaseFilterFactory" },
                      { "class":"solr.ManagedStopFilterFactory", "managed":"english" },
                      { "class":"solr.ManagedSynonymGraphFilterFactory", "managed":"english" },
                      { "class":"solr.PorterStemFilterFactory" }
                  ]
              }
          }
      }

After I add a document

{
  "id": 100,
  "articleTitle": "Best smartphone"
} 

I update the synonyms list by API

curl -X PUT -H 'Content-type:application/json' --data-binary '["iphone", "smartphone"]' "http://localhost:8983/solr/articles/schema/analysis/synonyms/english"

and reload the collection by API

http://localhost:8983/solr/admin/collections?action=RELOAD&name=articles

However when I try to search the documents don't pop-up.

http://localhost:8983/solr/articles/select?q=articleTitle:iphone

No result are returned. I expected that added document will be returned.

It works only if I first update the synonyms list and after that add the document into collection.

How to configure Solr to find the documents by synonyms if the synonyms are changed after documents are created?

0

There are 0 best solutions below