Re: Synonym questions
i have a similar use case where i want to preserve original words forexamplei have one way mapping at index time monsoon,sony,levinson => audio system when i index document for example with word sony i want ot index audio system as well as the brand name ie sony. so if some one types category:sony i want highlighted resutls. if user types category:audio system i want the same document too. i initially thought there might be some property like preserveOriginal for synonym filter too like we had for worddelimiter tokeniser. please let me know is there any alternative. Thanks darniz hossman wrote: > > > : 1) For some of my synonyms, it seems to make senses to simply replace > the > : original word with the other (e.g. "theatre" => "theater", so searches > for > : either will find either). For others, I want to add an alternate term > while > : preserving the original (e.g. "cirque" => "circus", so searches for > "circus" > : find Cirque du Soleil, but searches for "cirque" only match "cirque", > not > : "circus". > > the simplest way i can think of to achieve something like this off the top > of my head is to do synonym injecting when idexing and don't use the > synonym filter at all when querying... > > theatre, theater => theatre, theater > circus => circus, cirque > > (but i haven't tested this to be sure it does what i think it does, and i > haven't thought about SynonymFilter very hard for a while now so i may be > forgetting something subtle) > > > > -Hoss > > > -- View this message in context: http://old.nabble.com/Synonym-questions-tp12078428p26896098.html Sent from the Solr - User mailing list archive at Nabble.com.
RE: Synonym questions
thanks > Date: Wed, 1 Oct 2008 05:55:33 -0700 > From: [EMAIL PROTECTED] > Subject: Re: Synonym questions > To: solr-user@lucene.apache.org > > Hm, > No, at this point in time synonyms have to be loaded from the text file. > Otis > -- > Sematext -- http://sematext.com/ -- Lucene - Solr - Nutch > > > > - Original Message >> From: dudes dudes >> To: solr-user@lucene.apache.org >> Sent: Wednesday, October 1, 2008 4:24:33 AM >> Subject: Synonym questions >> >> >> Hello all, >> >> >> Sorry if this question sound stupid ! :) >> >> Instead of mapping or grouping the Synonym terms in the Synonym.txt file... >> is >> it possible to to define a field in the schema ( for the Synonyms) and >> index >> them then >> at query, the index directory is used for the purpose of Synonyming not >> the >> Synonym.txt file ? >> >> >> thanks >> ak >> _ >> Discover Bird's Eye View now with Multimap from Live Search >> http://clk.atdmt.com/UKM/go/111354026/direct/01/ > _ Get all your favourite content with the slick new MSN Toolbar - FREE http://clk.atdmt.com/UKM/go/111354027/direct/01/
Re: Synonym questions
Hm, No, at this point in time synonyms have to be loaded from the text file. Otis -- Sematext -- http://sematext.com/ -- Lucene - Solr - Nutch - Original Message > From: dudes dudes <[EMAIL PROTECTED]> > To: solr-user@lucene.apache.org > Sent: Wednesday, October 1, 2008 4:24:33 AM > Subject: Synonym questions > > > Hello all, > > > Sorry if this question sound stupid ! :) > > Instead of mapping or grouping the Synonym terms in the Synonym.txt file... > is > it possible to to define a field in the schema ( for the Synonyms) and index > them then > at query, the index directory is used for the purpose of Synonyming not the > Synonym.txt file ? > > > thanks > ak > _ > Discover Bird's Eye View now with Multimap from Live Search > http://clk.atdmt.com/UKM/go/111354026/direct/01/
Synonym questions
Hello all, Sorry if this question sound stupid ! :) Instead of mapping or grouping the Synonym terms in the Synonym.txt file... is it possible to to define a field in the schema ( for the Synonyms) and index them then at query, the index directory is used for the purpose of Synonyming not the Synonym.txt file ? thanks ak _ Discover Bird's Eye View now with Multimap from Live Search http://clk.atdmt.com/UKM/go/111354026/direct/01/
Re: Synonym questions
: 1) For some of my synonyms, it seems to make senses to simply replace the : original word with the other (e.g. "theatre" => "theater", so searches for : either will find either). For others, I want to add an alternate term while : preserving the original (e.g. "cirque" => "circus", so searches for "circus" : find Cirque du Soleil, but searches for "cirque" only match "cirque", not : "circus". the simplest way i can think of to achieve something like this off the top of my head is to do synonym injecting when idexing and don't use the synonym filter at all when querying... theatre, theater => theatre, theater circus => circus, cirque (but i haven't tested this to be sure it does what i think it does, and i haven't thought about SynonymFilter very hard for a while now so i may be forgetting something subtle) -Hoss
Synonym questions
Hi - Just looking at synonyms, and had a couple of questions. 1) For some of my synonyms, it seems to make senses to simply replace the original word with the other (e.g. "theatre" => "theater", so searches for either will find either). For others, I want to add an alternate term while preserving the original (e.g. "cirque" => "circus", so searches for "circus" find Cirque du Soleil, but searches for "cirque" only match "cirque", not "circus". I was thinking that the best way to do this was with two different synonym filters. The replace filter would be used both at index and query time, the other only at index time. Does doing this using two synonym filters make sense? section from my schema.xml 2) For this to work, I need to use "includeOrig". It appears that "includeOrig" is hard coded to be false in SynonymFilterFactory. Is there any reason for this? It's pretty easy to change (diff below), any reason this should not be supported? Thanks, Tom Diffing vs. my local copy of 1.2, but it appears to be the same in HEAD. --- src/java/org/apache/solr/analysis/SynonymFilterFactory.java +++ src/java/org/apache/solr/analysis/SynonymFilterFactory.java (working copy) @@ -37,6 +37,7 @@ ignoreCase = getBoolean("ignoreCase",false); expand = getBoolean("expand",true); +includeOrig = getBoolean("includeOrig",false); if (synonyms != null) { List wlist=null; @@ -57,8 +58,9 @@ private SynonymMap synMap; private boolean ignoreCase; private boolean expand; + private boolean includeOrig; - private static void parseRules(List rules, SynonymMap map, String mappingSep, String synSep, boolean ignoreCase, boolean expansion) { + private void parseRules(List rules, SynonymMap map, String mappingSep, String synSep, boolean ignoreCase, boolean expansion) { int count=0; for (String rule : rules) { // To use regexes, we need an expression that specifies an odd number of chars. @@ -88,7 +90,6 @@ } } - boolean includeOrig=false; for (List fromToks : source) { count++; for (List toToks : target) {