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 Matthew Runo <mr...@zappos.com> on 2007/05/09 19:44:35 UTC

Dismax Config?

I'd love to see some explanation of what's going on here, and how to  
configure it for my own use. I've changed the fields to match my own  
columns, but it'd be great if I could actually understand it..

     243   <requestHandler name="dismax"  
class="solr.DisMaxRequestHandler" >
     244     <lst name="defaults">
     245      <str name="echoParams">explicit</str>
     246      <float name="tie">0.01</float>
     247      <str name="qf">
     248         text^0.5 description^1.0 name^5.0 style_id^1.5  
product_id^10.0 brand^4.1 product_type^1.4
     249      </str>
     250      <str name="pf">
     251         text^0.2 description^1.1 name^1.5 brand^1.4  
brandexact^1.9
     252      </str>
     253      <str name="bf">
     254         ord(poplarity)^0.5 recip(rord(price),1,1000,1000)^0.3
     255      </str>
     256      <str name="fl">
     257         product_id,name,price,score
     258      </str>
     259      <str name="mm">
     260         2&lt;-1 5&lt;-2 6&lt;90%
     261      </str>
     262      <int name="ps">100</int>
     263     </lst>
     264   </requestHandler>

Thank you!

+--------------------------------------------------------+
  | Matthew Runo
  | Zappos Development
  | mruno@zappos.com
  | 702-943-7833
+--------------------------------------------------------+



Re: Dismax Config?

Posted by Chris Hostetter <ho...@fucit.org>.
: Example:
: "a b"~1  will match fields with a b, a x b, or b a, but not b x a.
: The last would require a slop of 2

also note that there are two "slop" params in the DisMax handler ... "qs"
refers to how much "slop' will be used when querying the qf fields if the
user actually types in a query string containing quotes.  ie, if hte user
types in...

	"Chris Hostetter" Solr

that will create a big complex DisjunctionMaxQuery across all of hte qf
fields for the term Solr and the phrase "Chris Hostetter" ... and the "qs"
param will determine how much slop is allowed for the "qs" field

"ps" refers to the amount of slop that will be used on the artificially
constructed phrase query used to "boost" the scores of documents that
match the entire query string as a single phrase on any of the "pf"
fields.  in the previous example, "Chris Hostetter Solr" as a single
phrase will be queried across all of the "pf" fields with "ps" slop, and
any matches will get their overall scores increased.

As a general rules, you probably want qs to be small since it affects how
loose your matching will be, while ps can be quite large (because it's
only increasing the scores of existing matches, and regardless of the ps
value, looser matches will sore lower then tighter matches).  qs exists
mainly to deal with situations where you know there might be a small
offset between terms that you would otherwise consider sequential (ie: due
to synonym injection, or stop word removal)



-Hoss


Re: Dismax Config?

Posted by Yonik Seeley <yo...@apache.org>.
On 5/9/07, Matthew Runo <mr...@zappos.com> wrote:
> Ah hah! After doing some research, slop is a fun term for how sloppy
> a match SOLR will make.
>
> Eg, slop = 0, means that only exact matches will work. Slop = 1 means
> that they can be off by one word... etc
>
> Yes?

All terms must appear, but the positions can be off.  It's called a
sloppy phrase query, or proximity query.  It's actually based on how
many "moves" need to be made to get the tokens to match in the correct
positions.

Example:
"a b"~1  will match fields with a b, a x b, or b a, but not b x a.
The last would require a slop of 2

-Yonik

Re: Dismax Config?

Posted by Matthew Runo <mr...@zappos.com>.
Ah hah! After doing some research, slop is a fun term for how sloppy  
a match SOLR will make.

Eg, slop = 0, means that only exact matches will work. Slop = 1 means  
that they can be off by one word... etc

Yes?

+--------------------------------------------------------+
  | Matthew Runo
  | Zappos Development
  | mruno@zappos.com
  | 702-943-7833
+--------------------------------------------------------+


On May 9, 2007, at 11:19 AM, Matthew Runo wrote:

> Perfect! I had seen the wiki, but did not visit the class page  
> since I am using Perl.
>
> What is "slop"? heh
>
> +--------------------------------------------------------+
>  | Matthew Runo
>  | Zappos Development
>  | mruno@zappos.com
>  | 702-943-7833
> +--------------------------------------------------------+
>
>
> On May 9, 2007, at 11:00 AM, Ryan McKinley wrote:
>
>>
>> check:
>> http://wiki.apache.org/solr/DisMaxRequestHandler
>>
>> For now, most of the docs for dismax are in the javadocs:
>> http://lucene.apache.org/solr/api/org/apache/solr/request/ 
>> DisMaxRequestHandler.html
>>
>>
>>
>> Matthew Runo wrote:
>>> I'd love to see some explanation of what's going on here, and how  
>>> to configure it for my own use. I've changed the fields to match  
>>> my own columns, but it'd be great if I could actually understand  
>>> it..
>>>     243   <requestHandler name="dismax"  
>>> class="solr.DisMaxRequestHandler" >
>>>     244     <lst name="defaults">
>>>     245      <str name="echoParams">explicit</str>
>>>     246      <float name="tie">0.01</float>
>>>     247      <str name="qf">
>>>     248         text^0.5 description^1.0 name^5.0 style_id^1.5  
>>> product_id^10.0 brand^4.1 product_type^1.4
>>>     249      </str>
>>>     250      <str name="pf">
>>>     251         text^0.2 description^1.1 name^1.5 brand^1.4  
>>> brandexact^1.9
>>>     252      </str>
>>>     253      <str name="bf">
>>>     254         ord(poplarity)^0.5 recip(rord(price),1,1000,1000) 
>>> ^0.3
>>>     255      </str>
>>>     256      <str name="fl">
>>>     257         product_id,name,price,score
>>>     258      </str>
>>>     259      <str name="mm">
>>>     260         2&lt;-1 5&lt;-2 6&lt;90%
>>>     261      </str>
>>>     262      <int name="ps">100</int>
>>>     263     </lst>
>>>     264   </requestHandler>
>>> Thank you!
>>> +--------------------------------------------------------+
>>>  | Matthew Runo
>>>  | Zappos Development
>>>  | mruno@zappos.com
>>>  | 702-943-7833
>>> +--------------------------------------------------------+
>>
>


Re: Dismax Config?

Posted by Matthew Runo <mr...@zappos.com>.
Perfect! I had seen the wiki, but did not visit the class page since  
I am using Perl.

What is "slop"? heh

+--------------------------------------------------------+
  | Matthew Runo
  | Zappos Development
  | mruno@zappos.com
  | 702-943-7833
+--------------------------------------------------------+


On May 9, 2007, at 11:00 AM, Ryan McKinley wrote:

>
> check:
> http://wiki.apache.org/solr/DisMaxRequestHandler
>
> For now, most of the docs for dismax are in the javadocs:
> http://lucene.apache.org/solr/api/org/apache/solr/request/ 
> DisMaxRequestHandler.html
>
>
>
> Matthew Runo wrote:
>> I'd love to see some explanation of what's going on here, and how  
>> to configure it for my own use. I've changed the fields to match  
>> my own columns, but it'd be great if I could actually understand it..
>>     243   <requestHandler name="dismax"  
>> class="solr.DisMaxRequestHandler" >
>>     244     <lst name="defaults">
>>     245      <str name="echoParams">explicit</str>
>>     246      <float name="tie">0.01</float>
>>     247      <str name="qf">
>>     248         text^0.5 description^1.0 name^5.0 style_id^1.5  
>> product_id^10.0 brand^4.1 product_type^1.4
>>     249      </str>
>>     250      <str name="pf">
>>     251         text^0.2 description^1.1 name^1.5 brand^1.4  
>> brandexact^1.9
>>     252      </str>
>>     253      <str name="bf">
>>     254         ord(poplarity)^0.5 recip(rord(price),1,1000,1000)^0.3
>>     255      </str>
>>     256      <str name="fl">
>>     257         product_id,name,price,score
>>     258      </str>
>>     259      <str name="mm">
>>     260         2&lt;-1 5&lt;-2 6&lt;90%
>>     261      </str>
>>     262      <int name="ps">100</int>
>>     263     </lst>
>>     264   </requestHandler>
>> Thank you!
>> +--------------------------------------------------------+
>>  | Matthew Runo
>>  | Zappos Development
>>  | mruno@zappos.com
>>  | 702-943-7833
>> +--------------------------------------------------------+
>


Re: Dismax Config?

Posted by Ryan McKinley <ry...@gmail.com>.
check:
http://wiki.apache.org/solr/DisMaxRequestHandler

For now, most of the docs for dismax are in the javadocs:
http://lucene.apache.org/solr/api/org/apache/solr/request/DisMaxRequestHandler.html



Matthew Runo wrote:
> I'd love to see some explanation of what's going on here, and how to 
> configure it for my own use. I've changed the fields to match my own 
> columns, but it'd be great if I could actually understand it..
> 
>     243   <requestHandler name="dismax" class="solr.DisMaxRequestHandler" >
>     244     <lst name="defaults">
>     245      <str name="echoParams">explicit</str>
>     246      <float name="tie">0.01</float>
>     247      <str name="qf">
>     248         text^0.5 description^1.0 name^5.0 style_id^1.5 
> product_id^10.0 brand^4.1 product_type^1.4
>     249      </str>
>     250      <str name="pf">
>     251         text^0.2 description^1.1 name^1.5 brand^1.4 brandexact^1.9
>     252      </str>
>     253      <str name="bf">
>     254         ord(poplarity)^0.5 recip(rord(price),1,1000,1000)^0.3
>     255      </str>
>     256      <str name="fl">
>     257         product_id,name,price,score
>     258      </str>
>     259      <str name="mm">
>     260         2&lt;-1 5&lt;-2 6&lt;90%
>     261      </str>
>     262      <int name="ps">100</int>
>     263     </lst>
>     264   </requestHandler>
> 
> Thank you!
> 
> +--------------------------------------------------------+
>  | Matthew Runo
>  | Zappos Development
>  | mruno@zappos.com
>  | 702-943-7833
> +--------------------------------------------------------+
> 
> 
>