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 Xavier Schepler <xa...@sciences-po.fr> on 2010/08/30 15:55:16 UTC

Expanded Synonyms + phrase search

Hi,

several documents from my index contain the phrase : "PS et".
However, PS is expanded to "parti socialiste" and a phrase search for 
"PS et" fails.
A phrase search for "parti socialiste et" succeeds.

Can I have both queries working ?


Here's the field type :

    <fieldtype name="SyFR" class="solr.TextField">
      <analyzer type="index">
        <tokenizer class="solr.StandardTokenizerFactory"/>
        <filter class="solr.StandardFilterFactory"/>
        <!-- Synonyms -->
        <filter class="solr.SynonymFilterFactory" 
synonyms="synonyms-fr.txt" ignoreCase="true" expand="true"/>
        <filter class="solr.LowerCaseFilterFactory"/>
        <charFilter class="solr.MappingCharFilterFactory" 
mapping="mapping-ISOLatin1Accent.txt"/>
     </analyzer>
      <analyzer type="query">
        <tokenizer class="solr.StandardTokenizerFactory"/>
        <filter class="solr.StandardFilterFactory"/>
        <filter class="solr.LowerCaseFilterFactory"/>
        <charFilter class="solr.MappingCharFilterFactory" 
mapping="mapping-ISOLatin1Accent.txt"/>
      </analyzer>
    </fieldtype>

Re: Expanded Synonyms + phrase search

Posted by Jak Akdemir <ja...@gmail.com>.
Did you check ../admin/analysis.jsp page to see how index and query analyzer
behaved?
In usual, when you add "parti socialiste" to synonyms-fr.txt, it would
response correctly both of "PS et" and "parti socialiste" queries.

On Mon, Aug 30, 2010 at 4:55 PM, Xavier Schepler <
xavier.schepler@sciences-po.fr> wrote:

> Hi,
>
> several documents from my index contain the phrase : "PS et".
> However, PS is expanded to "parti socialiste" and a phrase search for "PS
> et" fails.
> A phrase search for "parti socialiste et" succeeds.
>
> Can I have both queries working ?
>
>
> Here's the field type :
>
>   <fieldtype name="SyFR" class="solr.TextField">
>     <analyzer type="index">
>       <tokenizer class="solr.StandardTokenizerFactory"/>
>       <filter class="solr.StandardFilterFactory"/>
>       <!-- Synonyms -->
>       <filter class="solr.SynonymFilterFactory" synonyms="synonyms-fr.txt"
> ignoreCase="true" expand="true"/>
>       <filter class="solr.LowerCaseFilterFactory"/>
>       <charFilter class="solr.MappingCharFilterFactory"
> mapping="mapping-ISOLatin1Accent.txt"/>
>    </analyzer>
>     <analyzer type="query">
>       <tokenizer class="solr.StandardTokenizerFactory"/>
>       <filter class="solr.StandardFilterFactory"/>
>       <filter class="solr.LowerCaseFilterFactory"/>
>       <charFilter class="solr.MappingCharFilterFactory"
> mapping="mapping-ISOLatin1Accent.txt"/>
>     </analyzer>
>   </fieldtype>
>