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 "Agethle, Matthias" <Ma...@siag.it> on 2010/02/08 14:07:24 UTC

Multi-word synonyms containing commas

Hi,

is it possible to have a synonym file where single synonyms can also contain commas, e.g. names like "Washington, George".
Perhaps it would suffice to tell the SynonymFilterFacotry to use another separator character (instead of the comma)?
I tried this and changed the line where the parseRules-method is called in the original implementation of SynonymFilterFactory (simply replacing "," with"#"),
but this didn't work as expected.

Thanks
Matthias


RE: Multi-word synonyms containing commas

Posted by "Agethle, Matthias" <Ma...@siag.it>.
Ok, that works (now I found it also in the example synonyms-file...) 

But what if I overwrite the synonyms-file after SOLR-startup? 
Is core-reloading the only way to do this?
I think of this steps:

1. Generate new synonym-file
2. Reload core and wait a minute
3. Re-index (as I'm using synonyms at index time)


-----Original Message-----
From: Ahmet Arslan [mailto:iorixxx@yahoo.com] 
Sent: Montag, 08. Februar 2010 18:48
To: solr-user@lucene.apache.org
Subject: Re: Multi-word synonyms containing commas

> Hi,
> 
> is it possible to have a synonym file where single synonyms can also 
> contain commas, e.g. names like "Washington, George".

Sure, you just need to escape that comma. e.g. 
Washington\, George, wg
a\,a => b\,b


      

Re: Multi-word synonyms containing commas

Posted by Ahmet Arslan <io...@yahoo.com>.
> Hi,
> 
> is it possible to have a synonym file where single synonyms
> can also contain commas, e.g. names like "Washington,
> George".

Sure, you just need to escape that comma. e.g. 
Washington\, George, wg
a\,a => b\,b