You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by cheops <m....@mediaskill.de> on 2013/09/11 17:04:25 UTC

synonyms not working

Hi,
I'm using solr4.4 and try to use different synonyms based on different
fieldtypes:

<fieldType name="text_general" class="solr.TextField"
positionIncrementGap="100">
      <analyzer type="index">
        <tokenizer class="solr.StandardTokenizerFactory"/>
        <filter class="solr.StopFilterFactory" ignoreCase="true"
words="stopwords.txt" />
        <filter class="solr.LowerCaseFilterFactory"/>
      </analyzer>
      <analyzer type="query">
        <tokenizer class="solr.StandardTokenizerFactory"/>
        <filter class="solr.StopFilterFactory" ignoreCase="true"
words="stopwords.txt" />
        <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt"
ignoreCase="true" expand="true"/>
        <filter class="solr.LowerCaseFilterFactory"/>
      </analyzer>
    </fieldType>


...I have the same fieldtype for english (name="text_general_en" and
synonyms="synonyms_en.txt").
The first fieldtype works fine, my synonyms are processed and the result is
as expected. But the "en"-version doesn't seem to work. I'm able to find the
original english words but the synonyms are not processed.
ps: yes, i know using synonyms at query time is not a good idea :-) ... but
can't change it here

Any help would be appreciated!

Thank you.

Best regards
Marcus



--
View this message in context: http://lucene.472066.n3.nabble.com/synonyms-not-working-tp4089318.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: synonyms not working

Posted by cheops <m....@mediaskill.de>.
thanx for your help..... could solve the problem meanwhile!
i used 
<analyzer type="query_en">
...which is wrong, it must be
<analyzer type="query">





--
View this message in context: http://lucene.472066.n3.nabble.com/synonyms-not-working-tp4089318p4089345.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: synonyms not working

Posted by Erick Erickson <er...@gmail.com>.
Attach &debug=query to your URL and inspect the parsed
query, you should be seeing the substitutions if you're
configured correctly. Multi-word synonyms at query time
have the "getting through the query parser" problem.

Best
Erick


On Wed, Sep 11, 2013 at 11:04 AM, cheops <m....@mediaskill.de> wrote:

> Hi,
> I'm using solr4.4 and try to use different synonyms based on different
> fieldtypes:
>
> <fieldType name="text_general" class="solr.TextField"
> positionIncrementGap="100">
>       <analyzer type="index">
>         <tokenizer class="solr.StandardTokenizerFactory"/>
>         <filter class="solr.StopFilterFactory" ignoreCase="true"
> words="stopwords.txt" />
>         <filter class="solr.LowerCaseFilterFactory"/>
>       </analyzer>
>       <analyzer type="query">
>         <tokenizer class="solr.StandardTokenizerFactory"/>
>         <filter class="solr.StopFilterFactory" ignoreCase="true"
> words="stopwords.txt" />
>         <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt"
> ignoreCase="true" expand="true"/>
>         <filter class="solr.LowerCaseFilterFactory"/>
>       </analyzer>
>     </fieldType>
>
>
> ...I have the same fieldtype for english (name="text_general_en" and
> synonyms="synonyms_en.txt").
> The first fieldtype works fine, my synonyms are processed and the result is
> as expected. But the "en"-version doesn't seem to work. I'm able to find
> the
> original english words but the synonyms are not processed.
> ps: yes, i know using synonyms at query time is not a good idea :-) ... but
> can't change it here
>
> Any help would be appreciated!
>
> Thank you.
>
> Best regards
> Marcus
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/synonyms-not-working-tp4089318.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>