There's some weridness with synonym expansion at query time when some of
them are phrases.
http://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters#solr.SynonymFilterFactory
Looks like the suggested practice is to do synonym expansion at index time
(e.g., the synonym filter with expand="true"), but I've never dealt with it.
On Fri, May 27, 2011 at 7:43 AM, Thomas Dowling <[log in to unmask]>wrote:
> Greetings--
>
> I'm trying to flesh out my synonyms.txt file for a couple of Solr indexes,
> and I stumbled across something weird. I added these lines to
> synonyms.txt:
>
> co2, carbon dioxide
> ch4, methane
>
>
> The second line worked as expected: I restarted Solr, reindexed, and could
> search ch4 and methane as synonyms of each other.
>
> The first line did something weird. Before the change, I can get results
> for both CO2 and for "CARBON DIOXIDE" (just different results). After the
> change, searching CO2 got zero results, as did "CARBON DIOXIDE". So at
> least they're acting like synonyms, right? But why in the world do they
> both stop finding hits?
>
> Pre-change:
> CO2 225 hits
> "CARBON DIOXIDE" 130 hits
> CARBON DIOXIDE 1030 hits
>
> Post-change:
> CO2 0 hits
> "CARBON DIOXIDE" 0 hits
> CARBON DIOXIDE 1030 hits
>
>
> Also, if I want to be able to search for Greek letters by name (alpha,
> beta, etc.), is there a better way than to use synonmyms.txt?
>
> Ä,ä,delta
>
>
> TIA
>
> --
> Thomas Dowling
> [log in to unmask]
>
--
Bill Dueber
Library Systems Programmer
University of Michigan Library
|