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 dm_tim <dm...@yahoo.com> on 2012/11/13 22:25:15 UTC

Solr v4: Synonyms... better at index time or query time?

I'm looking at the sample docs for Solr v4 and I noted something in the
schema.xml file: The field type uses the synonymFilterFactory in the query
section but has it commented out in the index section. What would the
trade-offs be to using the synonymFilterFactory in the index section
instead. I assume that it would be pointless to use it in both sections.

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



--
View this message in context: http://lucene.472066.n3.nabble.com/Solr-v4-Synonyms-better-at-index-time-or-query-time-tp4020179.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Solr v4: Synonyms... better at index time or query time?

Posted by dm_tim <dm...@yahoo.com>.
Good to know. Thanks.

T



--
View this message in context: http://lucene.472066.n3.nabble.com/Solr-v4-Synonyms-better-at-index-time-or-query-time-tp4020179p4020198.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Solr v4: Synonyms... better at index time or query time?

Posted by Walter Underwood <wu...@wunderwood.org>.
Don't use query time synonyms. Explanation here:

http://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters#solr.SynonymFilterFactory

wunder

On Nov 13, 2012, at 1:25 PM, dm_tim wrote:

> I'm looking at the sample docs for Solr v4 and I noted something in the
> schema.xml file: The field type uses the synonymFilterFactory in the query
> section but has it commented out in the index section. What would the
> trade-offs be to using the synonymFilterFactory in the index section
> instead. I assume that it would be pointless to use it in both sections.
> 
> Example below:
> <fieldType name="text_general" class="solr.TextField"
> positionIncrementGap="100">
>  <analyzer type="index">
>    <tokenizer class="solr.LowerCaseTokenizerFactory"/>
>    <filter class="solr.StopFilterFactory" ignoreCase="true"
> words="stopwords.txt" enablePositionIncrements="true" />
> 
>    <filter class="solr.LowerCaseFilterFactory"/>
>  </analyzer>
>  <analyzer type="query">
>    <tokenizer class="solr.LowerCaseTokenizerFactory"/>
>    <filter class="solr.StopFilterFactory" ignoreCase="true"
> words="stopwords.txt" enablePositionIncrements="true" />
>    <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt"
> ignoreCase="true" expand="true"/>
>    <filter class="solr.LowerCaseFilterFactory"/>
>  </analyzer>
> </fieldType>