There are some well-understood problems with query-time synonyms. Read about 
them here:

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

Expanding synonyms at both index and query time causes a different problem, 
over-counting the score for any term in the synonym map.

wunder

On Apr 9, 2012, at 12:14 PM, Jeevanandam Madanagopal wrote:

> I agree partially, it actually depends. For instance during index time few of 
> the synonyms mapping may or may not expand (for e.g.. frequent data index 
> population from different source). So good apply at index time as well as 
> query time to achieve complete ratio. Mostly of the time I did similar 
> settings to meet customer requirements.
> 
> For example: 
> -----------------
> Below sample text datatype with synonyms at index & query time (below config 
> has similar analyzer structure of tokenizer & filter; so we can keep commonly 
> one <analyzer> config too.) 
> 
> <fieldType name="text" class="solr.TextField" positionIncrementGap="100" 
> autoGeneratePhraseQueries="true">
>      <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.KeywordMarkerFilterFactory" 
> protected="protwords.txt"/>
>        <filter class="solr.PorterStemFilterFactory"/>
>      </analyzer>
>      <analyzer type="query">
>        <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="0" catenateNumbers="0" catenateAll="0" 
> splitOnCaseChange="1"/>
>        <filter class="solr.LowerCaseFilterFactory"/>
>        <filter class="solr.KeywordMarkerFilterFactory" 
> protected="protwords.txt"/>
>        <filter class="solr.PorterStemFilterFactory"/>
>      </analyzer>
>    </fieldType>
> 
> -Jeevanandam
> 
> 
> On Apr 10, 2012, at 12:18 AM, Walter Underwood wrote:
> 
>> That is not a good configuration. Synonyms should be expanded at index time, 
>> not query time. --wunder
>> 
>> On Apr 9, 2012, at 11:43 AM, Jeevanandam Madanagopal wrote:
>> 
>>> Srini -
>>> 
>>> This "text" datatype comes as sample configuration in SOLR distribution. 
>>> Check this, it may suit your need!
>>> 
>>> <fieldType name="text" class="solr.TextField" positionIncrementGap="100" 
>>> autoGeneratePhraseQueries="true">
>>>    <analyzer type="index">
>>>      <tokenizer class="solr.WhitespaceTokenizerFactory"/>
>>>      <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.KeywordMarkerFilterFactory" 
>>> protected="protwords.txt"/>
>>>      <filter class="solr.PorterStemFilterFactory"/>
>>>    </analyzer>
>>>    <analyzer type="query">
>>>      <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="0" catenateNumbers="0" 
>>> catenateAll="0" splitOnCaseChange="1"/>
>>>      <filter class="solr.LowerCaseFilterFactory"/>
>>>      <filter class="solr.KeywordMarkerFilterFactory" 
>>> protected="protwords.txt"/>
>>>      <filter class="solr.PorterStemFilterFactory"/>
>>>    </analyzer>
>>>  </fieldType>
>>> 
>>> 
>>> -Jeevanandam
>>> 
>>> On Apr 10, 2012, at 12:08 AM, Walter Underwood wrote:
>>> 
>>>> You will need to define or customize a field type for text. 
>>>> 
>>>> The example schema.xml file that is installed with Solr 3.5 has a several 
>>>> kinds of text fields, "text_general" and "text_en" are good places to 
>>>> start. You can use one of those, then customize it.
>>>> 
>>>> wunder
>>>> 
>>>> On Apr 9, 2012, at 11:27 AM, srini wrote:
>>>> 
>>>>> Hi Thanks for your reply. As per your suggestion I changed XML field type 
>>>>> to
>>>>> text. 
>>>>> 
>>>>> <field name="XML" type="string" indexed="true" stored="true"
>>>>> required="true"/>   
>>>>> 
>>>>> but when I start solr it is throwing following exception.
>>>>> SEVERE: org.apache.solr.common.SolrException: Unknown fieldtype 'text'
>>>>> specified on field XML
>>>>> 
>>>>> Any suggestions!!(Thanks for your reply)
>>>>> 
>>>>> --
>>>>> View this message in context: 
>>>>> http://lucene.472066.n3.nabble.com/Solr-is-indexing-but-not-showing-results-tp3897176p3897626.html
>>>>> Sent from the Solr - User mailing list archive at Nabble.com.
>>>> 
>> 
>> 
>> 
>> 
> 

--
Walter Underwood
wun...@wunderwood.org



Reply via email to