OpenSextant / SolrTextTagger

A text tagger based on Lucene / Solr, using FST technology
Apache License 2.0
173 stars 37 forks source link

synonyms with SolrTextTagger #75

Closed necnec closed 6 years ago

necnec commented 6 years ago

Hi David! Thanks for this project. I'm new with Solr and I'm trying to use synonyms with SolrTextTagger. In documentation, I've found that you shouldn't use synonyms in query time. So I'm trying to add synonyms in index time. My config seems like:

curl -X POST -H 'Content-type:application/json'  http://localhost:8983/solr/companies/schema -d '{
  "add-field-type":{
    "name":"tag",
    "class":"solr.TextField",
    "omitNorms":true,
    "indexAnalyzer":{
      "tokenizer":{ 
         "class":"solr.StandardTokenizerFactory" },
      "filters":[
        {"class":"solr.SynonymFilterFactory", "synonyms":"synonims.txt", "ignoreCase":"true", "expand":"true"},
        {"class":"org.opensextant.solrtexttagger.ConcatenateFilterFactory"}
      ]},
    "queryAnalyzer":{
      "tokenizer":{ 
         "class":"solr.StandardTokenizerFactory" },
      "filters":[

      ]}
    },

  "add-field":{ "name":"name",     "type":"text_general"},

  "add-field":{ "name":"name_tag", "type":"tag",          "stored":false },

  "add-copy-field":{ "source":"name", "dest":[ "name_tag" ]}
}'

but it doesn't work well. So do synonyms are supported by SolrTextTagger at all or I'm doing something wrong? Thanks.

dsmiley commented 6 years ago

Hi, If you search the README.md for "synonyms", you should see that it's expressly not supported. However if you get the 1.1.1 version of the project (e.g. via the tag) then that version supports synonyms.