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 Scott Zhang <ma...@gmail.com> on 2010/06/30 10:08:09 UTC

Strange problem when use dismax handler

Hi. All.
   I am using default dismax to search within solr.
The problem is when I search I want to specify the "type" to restrict the
result.
Here is what I do:
1. Query String with one type (Works!)
((((:"design")) AND ((type:"product") )))
2. Query String with 2 types (Works!)
((((:"design")) AND ((type:"product") OR (type:"member"))))
3. Query String with 3 types (Works!)
((((:"design")) AND ((type:"product") OR (type:"member") OR (type:"forum")
)))
4. Query string with more than 3 types (doesn't work!)
((((:"design")) AND ((type:"product") OR (type:"member") OR (type:"forum")
OR (type:"stamp") OR (type:"answer") OR (type:"page"))))
Nothing was returned.
Don't know why. I think this should be caused by dismax setting, probably
mm (Minimum 'Should' Match)

But I have no idea how to configure it?

Please help. Thanks!


Regards.
Scott

Re: Strange problem when use dismax handler

Posted by Scott Zhang <ma...@gmail.com>.
Well. I figured it out.

I should use fq parameter.

&fq=type:music type:movie type:product



On Wed, Jun 30, 2010 at 4:15 PM, Scott Zhang <ma...@gmail.com> wrote:

> I use debugQuery to check my query url:
> I notice the query url is parsed incorrectly.
>
> The "type:book" was parsed as query string too. Sign~~~
>
> +((+DisjunctionMaxQuery((keyword_level1:design^10.0 |
> keyword_level2:design)~0.01) DisjunctionMaxQuery((keyword_level1:type^10.0 |
> keyword_level2:type)~0.01) DisjunctionMaxQuery((keyword_level1:product^10.0
> | keyword_level2:product)~0.01)
> DisjunctionMaxQuery((keyword_level1:type^10.0 | keyword_level2:type)~0.01)
> DisjunctionMaxQuery((keyword_level1:book^10.0 |
> keyword_level2:book)~0.01))~3) ()
>
>
> Then the question is how to specify the query filed , as in my case, type =
> "book" besides use the "design" to search over 2 fields ?
>
> Thanks
>
>
> On Wed, Jun 30, 2010 at 4:08 PM, Scott Zhang <ma...@gmail.com>wrote:
>
>> Hi. All.
>>    I am using default dismax to search within solr.
>> The problem is when I search I want to specify the "type" to restrict the
>> result.
>> Here is what I do:
>> 1. Query String with one type (Works!)
>> ((((:"design")) AND ((type:"product") )))
>> 2. Query String with 2 types (Works!)
>> ((((:"design")) AND ((type:"product") OR (type:"member"))))
>> 3. Query String with 3 types (Works!)
>> ((((:"design")) AND ((type:"product") OR (type:"member") OR (type:"forum")
>> )))
>> 4. Query string with more than 3 types (doesn't work!)
>> ((((:"design")) AND ((type:"product") OR (type:"member") OR (type:"forum")
>> OR (type:"stamp") OR (type:"answer") OR (type:"page"))))
>> Nothing was returned.
>> Don't know why. I think this should be caused by dismax setting, probably
>> mm (Minimum 'Should' Match)
>>
>> But I have no idea how to configure it?
>>
>> Please help. Thanks!
>>
>>
>> Regards.
>> Scott
>>
>>
>>
>

Re: Strange problem when use dismax handler

Posted by Scott Zhang <ma...@gmail.com>.
I use debugQuery to check my query url:
I notice the query url is parsed incorrectly.

The "type:book" was parsed as query string too. Sign~~~

+((+DisjunctionMaxQuery((keyword_level1:design^10.0 |
keyword_level2:design)~0.01) DisjunctionMaxQuery((keyword_level1:type^10.0 |
keyword_level2:type)~0.01) DisjunctionMaxQuery((keyword_level1:product^10.0
| keyword_level2:product)~0.01)
DisjunctionMaxQuery((keyword_level1:type^10.0 | keyword_level2:type)~0.01)
DisjunctionMaxQuery((keyword_level1:book^10.0 |
keyword_level2:book)~0.01))~3) ()


Then the question is how to specify the query filed , as in my case, type =
"book" besides use the "design" to search over 2 fields ?

Thanks

On Wed, Jun 30, 2010 at 4:08 PM, Scott Zhang <ma...@gmail.com> wrote:

> Hi. All.
>    I am using default dismax to search within solr.
> The problem is when I search I want to specify the "type" to restrict the
> result.
> Here is what I do:
> 1. Query String with one type (Works!)
> ((((:"design")) AND ((type:"product") )))
> 2. Query String with 2 types (Works!)
> ((((:"design")) AND ((type:"product") OR (type:"member"))))
> 3. Query String with 3 types (Works!)
> ((((:"design")) AND ((type:"product") OR (type:"member") OR (type:"forum")
> )))
> 4. Query string with more than 3 types (doesn't work!)
> ((((:"design")) AND ((type:"product") OR (type:"member") OR (type:"forum")
> OR (type:"stamp") OR (type:"answer") OR (type:"page"))))
> Nothing was returned.
> Don't know why. I think this should be caused by dismax setting, probably
> mm (Minimum 'Should' Match)
>
> But I have no idea how to configure it?
>
> Please help. Thanks!
>
>
> Regards.
> Scott
>
>
>