RE: Synonym Filter disable at query time

2011-05-10 Thread mtraynham
Just a heads up on a solution.

copyField wasn't need, but a new fieldType and a non-indexed, non-stored
field was added.

Within a new Synonym processor that executes right before the
AnalyzerQueryNodeProcessor, I was able to modify the field name for each
node to point at the new field.  Therefore I could build out the necessary
synonym values from the tokenizer and then reassign them all back to the
original field with whatever boosts they needed.  This allowed me to retain
the original value match, to keep it's boost at 1 and then boost the
synonyms according to a user specified boost value.  Works perfectly.

Thanks again for the help.

--
View this message in context: 
http://lucene.472066.n3.nabble.com/Synonym-Filter-disable-at-query-time-tp2919876p2923775.html
Sent from the Solr - User mailing list archive at Nabble.com.


RE: Synonym Filter disable at query time

2011-05-10 Thread Robert Petersen
Very nice! Good job! :)

-Original Message-
From: mtraynham [mailto:mtrayn...@digitalsmiths.com] 
Sent: Tuesday, May 10, 2011 9:44 AM
To: solr-user@lucene.apache.org
Subject: RE: Synonym Filter disable at query time

Just a heads up on a solution.

copyField wasn't need, but a new fieldType and a non-indexed, non-stored
field was added.

Within a new Synonym processor that executes right before the
AnalyzerQueryNodeProcessor, I was able to modify the field name for each
node to point at the new field.  Therefore I could build out the
necessary
synonym values from the tokenizer and then reassign them all back to the
original field with whatever boosts they needed.  This allowed me to
retain
the original value match, to keep it's boost at 1 and then boost the
synonyms according to a user specified boost value.  Works perfectly.

Thanks again for the help.

--
View this message in context:
http://lucene.472066.n3.nabble.com/Synonym-Filter-disable-at-query-time-
tp2919876p2923775.html
Sent from the Solr - User mailing list archive at Nabble.com.


RE: Synonym Filter disable at query time

2011-05-09 Thread Robert Petersen
Just make another field using copyfield which the other field does not
apply synonyms to the text and then search either the one with or
without from the front end...  that will be your selector.  :)

-Original Message-
From: mtraynham [mailto:mtrayn...@digitalsmiths.com] 
Sent: Monday, May 09, 2011 11:17 AM
To: solr-user@lucene.apache.org
Subject: Synonym Filter disable at query time

I would like to be able to disable the synonym filter during runtime
based on
a query parameter, say 'synoynms=true' or 'synonyms=false'.

Is there a way within the AnaylzerQueryNodeProcessor or QParser that I
can
remove the SynonymFilter from the AnalyzerAttributes?  

It seems that the Analyzer has a hashmap for it's 'analyzers' but I
cannot
find the declaration of this item.

Am I going about this wrong is also another question I had...


--
View this message in context:
http://lucene.472066.n3.nabble.com/Synonym-Filter-disable-at-query-time-
tp2919876p2919876.html
Sent from the Solr - User mailing list archive at Nabble.com.


RE: Synonym Filter disable at query time

2011-05-09 Thread mtraynham
Awesome thanks!  Also, you wouldn't happen to have any insight on boosting
synonyms lower than the original query after they were stemmed, would you?

Say if I had synonyms turned on:

The TokenStream is setup to do Synonyms - StopFilter - LowerCaseFilter -
SnowballPorter.

Say I search for Thomas, synonyms produces Thomas, Tom, Tommy.
The SnowballPorter produces Tom, Tommi, Thoma.

Is there a way to know Thoma would match the original term, so it could be
boosted higher?



--
View this message in context: 
http://lucene.472066.n3.nabble.com/Synonym-Filter-disable-at-query-time-tp2919876p2920342.html
Sent from the Solr - User mailing list archive at Nabble.com.


RE: Synonym Filter disable at query time

2011-05-09 Thread mtraynham
Actually now that I think about it, with copy fields I can just single out
the Synonym reader and boost from an earlier processor.

Thanks again though, that solved a lot of headache!

--
View this message in context: 
http://lucene.472066.n3.nabble.com/Synonym-Filter-disable-at-query-time-tp2919876p2920510.html
Sent from the Solr - User mailing list archive at Nabble.com.


RE: Synonym Filter disable at query time

2011-05-09 Thread Robert Petersen
I was thinking search both and boost non-synonym field perhaps?

-Original Message-
From: mtraynham [mailto:mtrayn...@digitalsmiths.com] 
Sent: Monday, May 09, 2011 1:20 PM
To: solr-user@lucene.apache.org
Subject: RE: Synonym Filter disable at query time

Awesome thanks!  Also, you wouldn't happen to have any insight on
boosting
synonyms lower than the original query after they were stemmed, would
you?

Say if I had synonyms turned on:

The TokenStream is setup to do Synonyms - StopFilter - LowerCaseFilter
-
SnowballPorter.

Say I search for Thomas, synonyms produces Thomas, Tom, Tommy.
The SnowballPorter produces Tom, Tommi, Thoma.

Is there a way to know Thoma would match the original term, so it could
be
boosted higher?



--
View this message in context:
http://lucene.472066.n3.nabble.com/Synonym-Filter-disable-at-query-time-
tp2919876p2920342.html
Sent from the Solr - User mailing list archive at Nabble.com.


RE: Synonym Filter disable at query time

2011-05-09 Thread Robert Petersen
Yay!   :)

-Original Message-
From: mtraynham [mailto:mtrayn...@digitalsmiths.com] 
Sent: Monday, May 09, 2011 1:59 PM
To: solr-user@lucene.apache.org
Subject: RE: Synonym Filter disable at query time

Actually now that I think about it, with copy fields I can just single
out
the Synonym reader and boost from an earlier processor.

Thanks again though, that solved a lot of headache!

--
View this message in context:
http://lucene.472066.n3.nabble.com/Synonym-Filter-disable-at-query-time-
tp2919876p2920510.html
Sent from the Solr - User mailing list archive at Nabble.com.