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 Alex Thurlow <al...@blastro.com> on 2010/03/10 22:15:24 UTC

Matching a string across multiple fields

So on with the questions.  I'm indexing music, and I have artist and 
title fields.  It works great if I just search for the artist or just 
for the title, but if I search for a string of both, that artist, title 
combination does not come up first.

For example, I have:
artist: Whitney Houston
title: Saving All My Love For You

artist: Whitney Houston
title: If I Told You That

artist: Whitney Houston
title: Exhale

If I search for "Whitney Houston Exhale", I would expect that song to 
come up first, but it doesn't.  Is there a special kind of matching or 
field setup I need to do for that?

-- 
Alex Thurlow
Blastro Networks

http://www.blastro.com
http://www.roxwel.com
http://www.yallwire.com


Re: Matching a string across multiple fields

Posted by Erik Hatcher <er...@gmail.com>.
What's your query parser?

What fields are you indexing and what types are they?  Are you using  
any copyField's?

What do you get from &debugQuery=true as the parsedQuery output?

	Erik


On Mar 10, 2010, at 4:15 PM, Alex Thurlow wrote:

> So on with the questions.  I'm indexing music, and I have artist and  
> title fields.  It works great if I just search for the artist or  
> just for the title, but if I search for a string of both, that  
> artist, title combination does not come up first.
>
> For example, I have:
> artist: Whitney Houston
> title: Saving All My Love For You
>
> artist: Whitney Houston
> title: If I Told You That
>
> artist: Whitney Houston
> title: Exhale
>
> If I search for "Whitney Houston Exhale", I would expect that song  
> to come up first, but it doesn't.  Is there a special kind of  
> matching or field setup I need to do for that?
>
> -- 
> Alex Thurlow
> Blastro Networks
>
> http://www.blastro.com
> http://www.roxwel.com
> http://www.yallwire.com
>


Re: Matching a string across multiple fields

Posted by Jan Høydahl / Cominvent <ja...@cominvent.com>.
You may like to check out the DisMax handler instead of hand-coding your queries. It has lots of features to tune stuff like this.

--
Jan Høydahl, search solution architect
Cominvent AS - www.cominvent.com
Training in Europe - www.solrtraining.com

On 10. mars 2010, at 22.15, Alex Thurlow wrote:

> So on with the questions.  I'm indexing music, and I have artist and title fields.  It works great if I just search for the artist or just for the title, but if I search for a string of both, that artist, title combination does not come up first.
> 
> For example, I have:
> artist: Whitney Houston
> title: Saving All My Love For You
> 
> artist: Whitney Houston
> title: If I Told You That
> 
> artist: Whitney Houston
> title: Exhale
> 
> If I search for "Whitney Houston Exhale", I would expect that song to come up first, but it doesn't.  Is there a special kind of matching or field setup I need to do for that?
> 
> -- 
> Alex Thurlow
> Blastro Networks
> 
> http://www.blastro.com
> http://www.roxwel.com
> http://www.yallwire.com
> 


Re: Matching a string across multiple fields

Posted by Static Void <st...@gmail.com>.
Alex Thurlow wrote:
> So on with the questions.  I'm indexing music, and I have artist and 
> title fields.  It works great if I just search for the artist or just 
> for the title, but if I search for a string of both, that artist, 
> title combination does not come up first.
>
> For example, I have:
> artist: Whitney Houston
> title: Saving All My Love For You
>
> artist: Whitney Houston
> title: If I Told You That
>
> artist: Whitney Houston
> title: Exhale
>
> If I search for "Whitney Houston Exhale", I would expect that song to 
> come up first, but it doesn't.  Is there a special kind of matching or 
> field setup I need to do for that?
>
Sounds like you need to copy those 2 fields into one and then just 
search that one field. Also checkout the min-should-match settings if 
you are using the dismax handler