Re: synonyms not working with copyfield

2010-05-17 Thread Chris Hostetter

: fields during indexing. However, my search interface is just a text
: box like Google and I need to take the query and return only those
: documents that match ALL terms in the query and if I am going to take

as mentioned previously in this thread: this is exactly what the dismax 
QParser was designed for.

-Hoss



Re: synonyms not working with copyfield

2010-05-13 Thread Gary
Hi Surajit
I aint sure if this is any help, but I had a similar problem but with stop 
words, they were not working with dismax queries. Well to cut a long story it 
seems that all the querying fields need to be configured with stopwords.

Maybe this has the similar affect with Synonyms confguration, thus your 
copyField should be defined as a type that is configured with the 
SynonymFilterFactory, just like 
person_name.

You can find some guidance here:

http://bibwild.wordpress.com/2010/04/14/solr-stop-wordsdismax-gotcha/

Gary





Re: synonyms not working with copyfield

2010-05-13 Thread Ahmet Arslan
 I have indexed person names in solr using synonym expansion
 and am getting a
 match when I explicitly use that field in my query
 (name:query). However,
 when I copy that field into another field using copyfield
 and search on that
 field, I don't get a match. Below are excerpts from
 schema.txt. I am new to
 Solr and appreciate any help! Thanks.
 
 Surajit
 
 fieldType name=person_name class=solr.TextField
 positionIncrementGap=100
       analyzer type=index
         tokenizer
 class=solr.WhitespaceTokenizerFactory/
         filter
 class=solr.WordDelimiterFilterFactory
 generateWordParts=1 generateNumberParts=0
 catenateWords=1
 catenateNumbers=0 catenateAll=0
 splitOnCaseChange=1/
         filter
 class=solr.LowerCaseFilterFactory/
         filter
 class=solr.SynonymFilterFactory
 synonyms=person-synonyms.txt ignoreCase=true
 expand=true/
       /analyzer
 /fieldType
 
 
 
 
 field name=sngr type=person_name multiValued=true
 indexed=true
 stored=true required=false / 
 
 
 
 
 field name=text type=text indexed=true
 stored=true
 multiValued=true/
 
 
 
 
  copyField source=sngr dest=text/

CopyField just copies raw text, i mean not analyzed. Do you have a filter
class=solr.SynonymFilterFactory synonyms=person-synonyms.txt 
ignoreCase=true expand=true/  in your text fieldType definition?





Re: synonyms not working with copyfield

2010-05-13 Thread surajit

Thanks much! I added a synonym filter to the copyfield and it started working
which is good, but the different fields that I copy into the copyfield need
different analysis and I no longer am able to do that. I can, of course,
search against the individual fields instead of the copyfield, but I want to
return a match only if ALL terms in the query are matched in the overall
document (as in an AND) and if I search against individual fields I am not
sure of an easy way to figure out if all terms matched in the overall
document. Any ideas?

surajit
-- 
View this message in context: 
http://lucene.472066.n3.nabble.com/synonyms-not-working-with-copyfield-tp814108p815263.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: synonyms not working with copyfield

2010-05-13 Thread Sachin

 take a look at the DismaxRequestHandler:

http://wiki.apache.org/solr/DisMaxRequestHandler

 


 

 

-Original Message-
From: surajit surajit.em...@gmail.com
To: solr-user@lucene.apache.org
Sent: Thu, May 13, 2010 9:52 pm
Subject: Re: synonyms not working with copyfield



Thanks much! I added a synonym filter to the copyfield and it started working
which is good, but the different fields that I copy into the copyfield need
different analysis and I no longer am able to do that. I can, of course,
search against the individual fields instead of the copyfield, but I want to
return a match only if ALL terms in the query are matched in the overall
document (as in an AND) and if I search against individual fields I am not
sure of an easy way to figure out if all terms matched in the overall
document. Any ideas?

surajit
-- 
View this message in context: 
http://lucene.472066.n3.nabble.com/synonyms-not-working-with-copyfield-tp814108p815263.html
Sent from the Solr - User mailing list archive at Nabble.com.

 


Re: synonyms not working with copyfield

2010-05-13 Thread Chris Hostetter
: which is good, but the different fields that I copy into the copyfield need
: different analysis and I no longer am able to do that. I can, of course,

Fundementally, Solr can only apply a single analysis chain to all of 
the text in a given field -- regardless of where it may be copied from.  
if it didn't, there would be no way to get matches at query time.

the query analysis has to make sense for the index analysis, so it has 
to be consistent.



-Hoss



Re: synonyms not working with copyfield

2010-05-13 Thread surajit

Understood and I can work with that limitation by using separate
fields during indexing. However, my search interface is just a text
box like Google and I need to take the query and return only those
documents that match ALL terms in the query and if I am going to take
the query and match it against each field (separately), how do I get
back documents matching all user terms? One soln I can think of is to
take all the field-specific analysis out of solr and do it as a
pre-process step, but want to make sure there isn't an alternative
within Solr.

surajit

On Thu, May 13, 2010 at 12:42 PM, Chris Hostetter-3 [via Lucene]
ml-node+815302-427668360-263...@n3.nabble.com wrote:
 : which is good, but the different fields that I copy into the copyfield
 need
 : different analysis and I no longer am able to do that. I can, of course,

 Fundementally, Solr can only apply a single analysis chain to all of
 the text in a given field -- regardless of where it may be copied from.
 if it didn't, there would be no way to get matches at query time.

 the query analysis has to make sense for the index analysis, so it has
 to be consistent.



 -Hoss



 
 View message @
 http://lucene.472066.n3.nabble.com/synonyms-not-working-with-copyfield-tp814108p815302.html
 To unsubscribe from Re: synonyms not working with copyfield, click here.


-- 
View this message in context: 
http://lucene.472066.n3.nabble.com/synonyms-not-working-with-copyfield-tp814108p815426.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: synonyms not working with copyfield

2010-05-13 Thread Nick Martin
Hi,

You could use a copyField against all fields and then AND the query terms 
given. Quite restrictive but all terms would then have to be present to match.
I'm still a relative newbie to Solr so perhaps I'm horribly wrong.

Cheers

Nick

On 13 May 2010, at 18:18, surajit wrote:

 
 Understood and I can work with that limitation by using separate
 fields during indexing. However, my search interface is just a text
 box like Google and I need to take the query and return only those
 documents that match ALL terms in the query and if I am going to take
 the query and match it against each field (separately), how do I get
 back documents matching all user terms? One soln I can think of is to
 take all the field-specific analysis out of solr and do it as a
 pre-process step, but want to make sure there isn't an alternative
 within Solr.
 
 surajit
 
 On Thu, May 13, 2010 at 12:42 PM, Chris Hostetter-3 [via Lucene]
 ml-node+815302-427668360-263...@n3.nabble.com wrote:
 : which is good, but the different fields that I copy into the copyfield
 need
 : different analysis and I no longer am able to do that. I can, of course,
 
 Fundementally, Solr can only apply a single analysis chain to all of
 the text in a given field -- regardless of where it may be copied from.
 if it didn't, there would be no way to get matches at query time.
 
 the query analysis has to make sense for the index analysis, so it has
 to be consistent.
 
 
 
 -Hoss
 
 
 
 
 View message @
 http://lucene.472066.n3.nabble.com/synonyms-not-working-with-copyfield-tp814108p815302.html
 To unsubscribe from Re: synonyms not working with copyfield, click here.
 
 
 -- 
 View this message in context: 
 http://lucene.472066.n3.nabble.com/synonyms-not-working-with-copyfield-tp814108p815426.html
 Sent from the Solr - User mailing list archive at Nabble.com.