Print

Print


I don't use Solr but the obvious difference between the two synonyms is that methane is one word and carbon dioxide is two. Is there some phrase qualifier one needs to use with the Solr synonyms file?

Bob Palian

-----Original Message-----
From: Code for Libraries [mailto:[log in to unmask]] On Behalf Of Mike Graves
Sent: Friday, May 27, 2011 10:25 AM
To: [log in to unmask]
Subject: Re: [CODE4LIB] What does my solr index have against carbon dioxide?

You'll probably get a better response from solr-users. In any case, posting the relevant fieldtype definition from your schema.xml and, for good measure, the results of a query with debugQuery on would be helpful. Off the top of my head, I'd say it may be a combination of not using index time expansion on the synonym filter (query time expansion on multi-word synonyms can be wonky) and a word delimiter filter that's configured to split on numerics, i.e. "co2" => "co", "2".

M

On 05/27/2011 07:43 AM, Thomas Dowling 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
>