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 Vernon Chapman <ch...@gmail.com> on 2009/03/03 17:15:54 UTC

Phrases in Synonyms.txt

I have a thesaurus that I would like to dump into the synonyms.txt In my 
thesaurus I have a term swine that
has a property called use_for which in my case is essentially a synonym.

The json representation of the term swine from my solr based thesaurus is:

{
	 "term":"swine",
	 "usefor":[
	  "hogs",
	  "pigs",
	  "porcine",
	  "Sus scrofa domestica"]
}


In an effort to expand my users results, I would like to use the terms 
in the "usefor" property as synonyms in the synonyms.txt file.
As far as I can tell this would work fine  in synonyms.txt

swine => hogs,pigs,porcine

The question is how would/could I add the final option "Sus scrofa 
domestica" to the list of synonyms for swine 
would any of these work or am I totally off base here?

1) swine => hogs,pigs,porcine,"Sus scrofa domestica"
2) swine => hogs,pigs,porcine,"Sus\ scrofa\ domestica"

Thanks in advance




Re: Phrases in Synonyms.txt

Posted by Vernon Chapman <ch...@gmail.com>.
Hoss,

Thanks I am the op on this question.
I figured it out by just trying t out and what your saying seems to
be correct.

Thanks


Chris Hostetter wrote:
> : The question is how would/could I add the final option "Sus scrofa domestica"
> : to the list of synonyms for swine would any of these work or am I totally off
> : base here?
> : 
> : 1) swine => hogs,pigs,porcine,"Sus scrofa domestica"
> : 2) swine => hogs,pigs,porcine,"Sus\ scrofa\ domestica"
>
> swine => hogs,pigs,porcine,Sus scrofa domestica
>
> ...only commas need special escaping.  there are some notes in the wiki 
> about the caveats to using multi-word synonyms you should check out 
> though.
>
>
> -Hoss
>
>
>   

Re: Phrases in Synonyms.txt

Posted by Chris Hostetter <ho...@fucit.org>.
: The question is how would/could I add the final option "Sus scrofa domestica"
: to the list of synonyms for swine would any of these work or am I totally off
: base here?
: 
: 1) swine => hogs,pigs,porcine,"Sus scrofa domestica"
: 2) swine => hogs,pigs,porcine,"Sus\ scrofa\ domestica"

swine => hogs,pigs,porcine,Sus scrofa domestica

...only commas need special escaping.  there are some notes in the wiki 
about the caveats to using multi-word synonyms you should check out 
though.


-Hoss