lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kostiantyn (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (SOLR-8798) org.apache.solr.rest.RestManager can't find cyrillic synonyms.
Date Wed, 16 Mar 2016 12:10:33 GMT

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

Kostiantyn commented on SOLR-8798:
----------------------------------

Got teh same issue with Danish synonyms.

I think the original problem in API. According to documentation https://cwiki.apache.org/confluence/display/solr/Managed+Resources
the example request below will add new synonym mapping.
{code}
curl -X PUT -H 'Content-type:application/json' --data-binary '{"mad":["angry","upset"]}' "http://localhost:8983/solr/techproducts/schema/analysis/synonyms/english"
{code}
If after that I will execute this request,
{code}
curl -X PUT -H 'Content-type:application/json' --data-binary '{"mad":["insane"]}' "http://localhost:8983/solr/techproducts/schema/analysis/synonyms/english"
{code}
I will get result mapping merged:
{code}
"initArgs":{"ignoreCase":false},
  "initializedOn":"2016-03-07T11:57:00.116Z",
  "updatedSinceInit":"2016-03-07T12:19:11.174Z",
  "managedMap":{
    "mad":["angry","upset","insane"]}}
{code}
If I need not merging but replacing, I have to at first delete the "mad" synonym at all and
then re-add it with new value.
{code}
curl -X DELETE -H 'Content-type:application/json' "http://localhost:8983/solr/techproducts/schema/analysis/synonyms/english/mad"
curl -X PUT -H 'Content-type:application/json' --data-binary '{"mad":["insane"]}' "http://localhost:8983/solr/techproducts/schema/analysis/synonyms/english"
{code}
That is how I could get replaced mapping:
{code}
"initArgs":{"ignoreCase":false},
  "initializedOn":"2016-03-07T11:57:00.116Z",
  "updatedSinceInit":"2016-03-07T12:19:11.174Z",
  "managedMap":{
    "mad":["insane"]}}
{code}
----
In my opinion this API could not be considered as totally finished. There is must be a method
to update a synonym mapping also.
Problem comes when you have non latin symbols (Dannish example "åbningstider") or cyrillic
symbols as well.
In this case you cannot perform deletion command because Solr will return 404 status.
Example. Add first synonym mapping for the Danish word badroom "soveværelse"
{code}
curl -X PUT -H 'Content-type:application/json' --data-binary '{"soveværelse":["køkken"]}'
"http://localhost:8983/solr/techproducts/schema/analysis/synonyms/daniish"
{code}
Than I need to replace mapping "køkken" (a kitchen) with "værelse" (a room). I cannot just
execute PUT request, it will merge "værelse" with existent "køkken" and I will get
{code}
"managedMap":{"soveværelse":["køkken","værelse"]}
{code}
But I actually need this
{code}
"managedMap":{"soveværelse":["værelse"]}
{code}
If I try to delete "soveværelse" I get an error 404 from Solr
{code}
 curl -X DELETE -H 'Content-type:application/json' --data-binary '{"mad":["angry","upset"]}'
"http://localhost:8983/solr/techproducts/schema/analysis/synonyms/daniish/soveværelse"
{
  "responseHeader":{
    "status":404,
    "QTime":10},
  "error":{
    "msg":"sovev%C3%A6relse not found in /schema/analysis/synonyms/2",
    "code":404}}
{code}



> org.apache.solr.rest.RestManager can't find cyrillic synonyms.
> --------------------------------------------------------------
>
>                 Key: SOLR-8798
>                 URL: https://issues.apache.org/jira/browse/SOLR-8798
>             Project: Solr
>          Issue Type: Bug
>    Affects Versions: 4.9.1
>            Reporter: Vitalii
>
> RestManager doesn't work well with cyrillic symbols.
> I'm able to create new synonyms via REST interface. But I have an error when I try to
get created synonyns with via request:
> http://localhost:8983/solr/collection1/schema/analysis/synonyms/18/ліжко
> I get this message in console log:
> {code}
> # solr/console.log
> 4591823 [qtp1281335597-14] INFO  org.apache.solr.rest.RestManager  – Resource not found
for /schema/analysis/synonyms/18/%D0%BB%D1%96%D0%B6%D0%BA%D0%BE, looking for parent: /schema/analysis/synonyms/18
> {code}
> But in synonyms file I have row with this word:
> {code}
> # /solr/collection1/conf/_schema_analysis_synonyms_18.json
>   "initArgs":{"ignoreCase":false},
>   "initializedOn":"2016-03-07T11:57:00.116Z",
>   "updatedSinceInit":"2016-03-07T12:19:11.174Z",
>   "managedMap":{
>     "ліжко":["кровать"],
>     "стілець":["стул"]}}
> {code}
> This issue have been tested by multiple persons and they can confirm that faced this
problem too.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message