1
votes

I'm beginner with solrand I have some difficulties to manipulate resources. In fact, I m using solr 7.2. in cloud mode using zookeper:

1/ I create collection named films

2/ I wanted to add synonyms file called "syns.txt" so I added it into "server/solr/configsets/_default/conf/"

3/ I execute the following command line

curl -X POST -H 'Content-type:application/json' --data-binary '{ "replace-field-type":{ "name":"text", "class":"solr.TextField", "positionIncrementGap":"100", "analyzer":{ "charFilters":[{ "class":"solr.PatternReplaceCharFilterFactory", "replacement":"$1$1", "pattern":"([a-zA-Z])\\1+" }], "tokenizer":{ "class":"solr.UAX29URLEmailTokenizerFactory" }, "filters":[{ "class":"solr.StopFilterFactory", "ignoreCase":true, "words":"stopwords.txt" }, { "class":"solr.LowerCaseFilterFactory" }, { "class":"solr.ASCIIFoldingFilterFactory" }, { "class":"solr.EnglishPossessiveFilterFactory" }, { "class":"solr.SynonymFilterFactory","synonyms":"syns.txt"} ]}}, "replace-field" : { "name":"text", "type":"text", "stored":true, "multiValued":true, "indexed":true } }' http://localhost:8983/solr/films/schema

the problem is that I get Can't find resource 'syns.txt' in classpath or '/configs/films' cwd=/home/solr-7.2.1/server\nCan't find resource 'syns.txt' in classpath or '/configs/films'.

I even change in server/solr/configsets/_default/conf/synonyms.txt and I didn't see the result in the synonyms.xt in the admin console. Can anyone help me please?

enter image description here

But I even change in server/solr/configsets/_default/conf/ contains:

enter image description here

1

1 Answers

0
votes

Try org.apache.solr.rest.schema.analysis.ManagedWordSetResource

curl -X PUT -H 'Content-type:application/json' --data-binary \
'{"class":"org.apache.solr.rest.schema.analysis.ManagedWordSetResource"}' \
"http://localhost:8983/solr/films/schema/analysis/synonyms/syns"