[ 
https://issues.apache.org/jira/browse/SOLR-14785?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17187166#comment-17187166
 ] 

Gitterh commented on SOLR-14785:
--------------------------------

Thank you. I've found the issue, it was that in application we also appending 
the fuzziness prefix `~1` and in this case the synonyms are not applied.

> Update synonyms by API and reload collection in Solr
> ----------------------------------------------------
>
>                 Key: SOLR-14785
>                 URL: https://issues.apache.org/jira/browse/SOLR-14785
>             Project: Solr
>          Issue Type: Task
>      Security Level: Public(Default Security Level. Issues are Public) 
>          Components: search
>    Affects Versions: 8.6.1
>            Reporter: Gitterh
>            Priority: Major
>
> 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?



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to