Yonik Seeley wrote:
> 
> On Tue, Jul 15, 2008 at 2:27 PM, swarag <[EMAIL PROTECTED]>
> wrote:
>> To my understanding, this means I am using synonyms at index time and NOT
>> query time. And yet, I am still having these problems with synonyms.
> 
> Can you give a specific example?  Use debugQuery=true to see what the
> resulting query is.
> You can also use the admin analysis page to see what the output of the
> index and query analyzers.
> 
> -Yonik
> 
> 

So it sounds like using the '=>' operator for synonyms that may or may not
contain multiple words causes problems.  So I changed my synonyms.txt to the
following:

club,bar,night cabaret

In schema.xml, I now have the following:
    <fieldType name="text" class="solr.TextField"
positionIncrementGap="100">
      <analyzer type="index">
        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
        <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt"
ignoreCase="true" expand="true"/>
        <filter class="solr.StopFilterFactory" ignoreCase="true"
words="stopwords.txt" enablePositionIncrements="true"/>
        <filter class="solr.WordDelimiterFilterFactory"
generateWordParts="1" generateNumberParts="1" catenateWords="1"
catenateNumbers="1" catenateAll="0" splitOnCaseChange="1"/>
        <filter class="solr.LowerCaseFilterFactory"/>
        <filter class="solr.EnglishPorterFilterFactory"
protected="protwords.txt"/>
        <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
      </analyzer>
      <analyzer type="query">
        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
        <filter class="solr.StopFilterFactory" ignoreCase="true"
words="stopwords.txt"/>
        <filter class="solr.WordDelimiterFilterFactory"
generateWordParts="1" generateNumberParts="1" catenateWords="0"
catenateNumbers="0" catenateAll="0" splitOnCaseChange="1"/>
        <filter class="solr.LowerCaseFilterFactory"/>
        <filter class="solr.EnglishPorterFilterFactory"
protected="protwords.txt"/>
        <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
      </analyzer>
    </fieldType>

As you can see, 'night cabaret' is my only multi-word synonym term. Searches
for 'bar' and 'club' now behave as expected.  However, if I search for JUST
'night' or JUST 'cabaret', it looks like it is still using the synonyms
'bar' and 'club', which is not what is desired.  I only want 'bar' and
'club' to be returned if a search for the complete 'night cabaret' is
submitted.

Since query-time synonyms is turned "off", the resulting
parsedquery_toString is simply "name:night", "name:cabaret", etc...

Thanks!
-- 
View this message in context: 
http://www.nabble.com/solr-synonyms-behaviour-tp15051211p18476205.html
Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to