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 mrw <mi...@gmail.com> on 2011/02/28 18:41:54 UTC
Basic Dismax syntax question
Say I have an index with first_name and last_name fields, and also a copy
field for the full name called full_name. Say I add two employees:
Napoleon Bonaparte and Napoleon Dynamite.
If I search for just the first or last name, or both names, with mm=1, I get
the expected results:
q=Napoleon&defType=dismax&tie=0.1&qf=first_name%20last_name&mm=1 // 2
results
q=Bonaparte&defType=dismax&tie=0.1&qf=first_name%20last_name&mm=1 // 2
results
q=Napoleon%20Bonaparte&defType=dismax&tie=0.1&qf=first_name%20last_name&mm=1
// 2 results
However, if I try to search for both names with mm=2 (which I think means
term1 AND term2), I get 0 results:
q=napoleon%20bonaparte&defType=dismax&tie=0.1&qf=first_name%20last_name&mm=2
// 0 results
q=napoleon%20bonaparte&defType=dismax&tie=0.1&qf=full_name&mm=2 // 0
results
I also see this when I put all fields (including the copy field) into the qf
parameter.
Thoughts?
Thanks!
--
View this message in context: http://lucene.472066.n3.nabble.com/Different-behavior-for-q-goo-com-vs-q-goo-com-in-queries-tp2168935p2596768.html
Sent from the Solr - User mailing list archive at Nabble.com.
Re: Basic Dismax syntax question
Posted by mrw <mi...@gmail.com>.
They're all set to LC. I was just coming up with a safe example to post.
It sounds like you don't see an issue with the syntax we're using?
Thanks
tjpoe wrote:
>
> i noticed that your search terms are using caps vs lower case, are your
> search fields perhaps not set to lowercase the terms and/or the search
> term?
>
> On Mon, Feb 28, 2011 at 10:41 AM, mrw <mi...@gmail.com> wrote:
>
>> Say I have an index with first_name and last_name fields, and also a copy
>> field for the full name called full_name. Say I add two employees:
>> Napoleon Bonaparte and Napoleon Dynamite.
>>
>> If I search for just the first or last name, or both names, with mm=1, I
>> get
>> the expected results:
>>
>> q=Napoleon&defType=dismax&tie=0.1&qf=first_name%20last_name&mm=1 //
>> 2
>> results
>> q=Bonaparte&defType=dismax&tie=0.1&qf=first_name%20last_name&mm=1 //
>> 2
>> results
>>
>> q=Napoleon%20Bonaparte&defType=dismax&tie=0.1&qf=first_name%20last_name&mm=1
>> // 2 results
>>
>>
>> However, if I try to search for both names with mm=2 (which I think means
>> term1 AND term2), I get 0 results:
>>
>>
>> q=napoleon%20bonaparte&defType=dismax&tie=0.1&qf=first_name%20last_name&mm=2
>> // 0 results
>> q=napoleon%20bonaparte&defType=dismax&tie=0.1&qf=full_name&mm=2 // 0
>> results
>>
>> I also see this when I put all fields (including the copy field) into the
>> qf
>> parameter.
>>
>>
>> Thoughts?
>>
>>
>> Thanks!
>>
>>
>> --
>> View this message in context:
>> http://lucene.472066.n3.nabble.com/Different-behavior-for-q-goo-com-vs-q-goo-com-in-queries-tp2168935p2596768.html
>> Sent from the Solr - User mailing list archive at Nabble.com.
>
>
--
View this message in context: http://lucene.472066.n3.nabble.com/Different-behavior-for-q-goo-com-vs-q-goo-com-in-queries-tp2168935p2597447.html
Sent from the Solr - User mailing list archive at Nabble.com.
Re: Basic Dismax syntax question
Posted by Tanner Postert <ta...@gmail.com>.
i noticed that your search terms are using caps vs lower case, are your
search fields perhaps not set to lowercase the terms and/or the search
term?
On Mon, Feb 28, 2011 at 10:41 AM, mrw <mi...@gmail.com> wrote:
> Say I have an index with first_name and last_name fields, and also a copy
> field for the full name called full_name. Say I add two employees:
> Napoleon Bonaparte and Napoleon Dynamite.
>
> If I search for just the first or last name, or both names, with mm=1, I
> get
> the expected results:
>
> q=Napoleon&defType=dismax&tie=0.1&qf=first_name%20last_name&mm=1 // 2
> results
> q=Bonaparte&defType=dismax&tie=0.1&qf=first_name%20last_name&mm=1 // 2
> results
>
> q=Napoleon%20Bonaparte&defType=dismax&tie=0.1&qf=first_name%20last_name&mm=1
> // 2 results
>
>
> However, if I try to search for both names with mm=2 (which I think means
> term1 AND term2), I get 0 results:
>
>
> q=napoleon%20bonaparte&defType=dismax&tie=0.1&qf=first_name%20last_name&mm=2
> // 0 results
> q=napoleon%20bonaparte&defType=dismax&tie=0.1&qf=full_name&mm=2 // 0
> results
>
> I also see this when I put all fields (including the copy field) into the
> qf
> parameter.
>
>
> Thoughts?
>
>
> Thanks!
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Different-behavior-for-q-goo-com-vs-q-goo-com-in-queries-tp2168935p2596768.html
> Sent from the Solr - User mailing list archive at Nabble.com.
Re: Basic Dismax syntax question
Posted by mrw <mi...@gmail.com>.
Fields are str type.
The issue happens regardless of case. I just threw in some examples using
names to highlight the issue. In the actual index, the data is the affected
fields is all LC, and I'm searching in LC.
Sounds like the syntax looks okay to you?
Thanks
iorixxx wrote:
>
>
> --- On Mon, 2/28/11, mrw <mi...@gmail.com> wrote:
>
>> From: mrw <mi...@gmail.com>
>> Subject: Basic Dismax syntax question
>> To: solr-user@lucene.apache.org
>> Date: Monday, February 28, 2011, 7:41 PM
>> Say I have an index with first_name
>> and last_name fields, and also a copy
>> field for the full name called full_name. Say I add
>> two employees:
>> Napoleon Bonaparte and Napoleon Dynamite.
>>
>> If I search for just the first or last name, or both names,
>> with mm=1, I get
>> the expected results:
>>
>> q=Napoleon&defType=dismax&tie=0.1&qf=first_name%20last_name&mm=1
>> // 2
>> results
>> q=Bonaparte&defType=dismax&tie=0.1&qf=first_name%20last_name&mm=1
>> // 2
>> results
>> q=Napoleon%20Bonaparte&defType=dismax&tie=0.1&qf=first_name%20last_name&mm=1
>> // 2 results
>>
>>
>> However, if I try to search for both names with mm=2 (which
>> I think means
>> term1 AND term2), I get 0 results:
>>
>> q=napoleon%20bonaparte&defType=dismax&tie=0.1&qf=first_name%20last_name&mm=2
>> // 0 results
>> q=napoleon%20bonaparte&defType=dismax&tie=0.1&qf=full_name&mm=2
>> // 0
>> results
>>
>> I also see this when I put all fields (including the copy
>> field) into the qf
>> parameter.
>
> &debugQuery=on will dump useful information. What is the field types of
> first_name, last_name and full_name?
>
> What happens when you query first letter uppercased?
>
> q=Napoleon%20Bonaparte&defType=dismax&tie=0.1&qf=first_name%20last_name&mm=2
>
>
>
>
>
>
--
View this message in context: http://lucene.472066.n3.nabble.com/Different-behavior-for-q-goo-com-vs-q-goo-com-in-queries-tp2168935p2597510.html
Sent from the Solr - User mailing list archive at Nabble.com.
Re: Basic Dismax syntax question
Posted by Ahmet Arslan <io...@yahoo.com>.
--- On Mon, 2/28/11, mrw <mi...@gmail.com> wrote:
> From: mrw <mi...@gmail.com>
> Subject: Basic Dismax syntax question
> To: solr-user@lucene.apache.org
> Date: Monday, February 28, 2011, 7:41 PM
> Say I have an index with first_name
> and last_name fields, and also a copy
> field for the full name called full_name. Say I add
> two employees:
> Napoleon Bonaparte and Napoleon Dynamite.
>
> If I search for just the first or last name, or both names,
> with mm=1, I get
> the expected results:
>
> q=Napoleon&defType=dismax&tie=0.1&qf=first_name%20last_name&mm=1
> // 2
> results
> q=Bonaparte&defType=dismax&tie=0.1&qf=first_name%20last_name&mm=1
> // 2
> results
> q=Napoleon%20Bonaparte&defType=dismax&tie=0.1&qf=first_name%20last_name&mm=1
> // 2 results
>
>
> However, if I try to search for both names with mm=2 (which
> I think means
> term1 AND term2), I get 0 results:
>
> q=napoleon%20bonaparte&defType=dismax&tie=0.1&qf=first_name%20last_name&mm=2
> // 0 results
> q=napoleon%20bonaparte&defType=dismax&tie=0.1&qf=full_name&mm=2
> // 0
> results
>
> I also see this when I put all fields (including the copy
> field) into the qf
> parameter.
&debugQuery=on will dump useful information. What is the field types of first_name, last_name and full_name?
What happens when you query first letter uppercased?
q=Napoleon%20Bonaparte&defType=dismax&tie=0.1&qf=first_name%20last_name&mm=2