2

This is my synonyms.txt

file system => filesystem

file set => fileset

version , release

latest, new

content, information

I have changed the synonyms.txt but synonyms are not working also help me to how to give space separated synonyms.

eg. foo bar => foobar

SierraOscar
  • 17,507
  • 6
  • 40
  • 68
nisarga lolage
  • 531
  • 1
  • 5
  • 14

2 Answers2

1

The field type "watson_text_en" we use in retrieve and rank doesn't have synonyms filter by default. You would need to update your schema.xml by adding that filter to make it available. Here is an instruction of where and what to add: In your schema.xml, in section, add <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/> into the tag list.

Depending on your requirement, you can add it to both/either of and , which tell solr whether to apply it in indexing and/or query time. Adding it to "index" would require reindexing to make the change effective, while adding into "query" does not. Also, list will run in the order you put it, so you can choose where to put this filter to let it run before/after certain filters. For example, if you put it before solr.LowerCaseFilterFactory, it's better to toggle on ignoreCase="true", because it will run before everything is transformed into lower case

nisarga lolage
  • 531
  • 1
  • 5
  • 14
0

Just to note regarding adding the filter into 'Query' - according to the Solr docs, http://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters#solr.SynonymFilterFactory this is a Very Bad Thing to Do.

Matt Warren
  • 669
  • 8
  • 18