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 roySolr <ro...@gmail.com> on 2011/11/10 10:40:06 UTC

One field must match with edismax

Hello,

I have some problems with my application. I have some fields and use edismax
to search between them. Now i want to configure that one field must match.
Let's give an example:

firstname  lastname     Nicknames
Lionel       messi         loe,pulga   

When i search i want only results that match on lastname and maybe other
fields. So "lionel pulga" gives no results but "messi leo" will matched. So
what i want is to configure that there always must be a match in one
field(lastname). Is this possible? 

--
View this message in context: http://lucene.472066.n3.nabble.com/One-field-must-match-with-edismax-tp3496232p3496232.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: One field must match with edismax

Posted by roySolr <ro...@gmail.com>.
Thanks, it was that easy. I was thinking about a variant of the mm option in
dismax but this works great!

--
View this message in context: http://lucene.472066.n3.nabble.com/One-field-must-match-with-edismax-tp3496232p3499312.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: One field must match with edismax

Posted by Ahmet Arslan <io...@yahoo.com>.

--- On Thu, 11/10/11, roySolr <ro...@gmail.com> wrote:

> From: roySolr <ro...@gmail.com>
> Subject: One field must match with edismax
> To: solr-user@lucene.apache.org
> Date: Thursday, November 10, 2011, 11:40 AM
> Hello,
> 
> I have some problems with my application. I have some
> fields and use edismax
> to search between them. Now i want to configure that one
> field must match.
> Let's give an example:
> 
> firstname  lastname     Nicknames
> Lionel       messi   
>      loe,pulga   
> 
> When i search i want only results that match on lastname
> and maybe other
> fields. So "lionel pulga" gives no results but "messi leo"
> will matched. So
> what i want is to configure that there always must be a
> match in one
> field(lastname). Is this possible? 


Hmm, how about filtering results with a filter query?

q=messi leo&fq={!edismax qf='lastname' mm='1'}messi leo

or

fq={!q.op=OR df=lastname}messi leo