Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

dismax solr request handler MM , PS and Q.ALT

Tags:

solr

lucene

I'm testing the dismax requesthandler , im trying to customize the mm ( Minimum Match ) Parameter ( i already looked at the documentation )

 <str name="mm">
 2<-2 3<-70% 5<-50%  
 </str>
 <int name="ps">100</int>
 <str name="q.alt">*:*</str>

I have 3 Questions :

  • mm , i understood what it does , i want to verify if my param is ok ,

    correct me if im wrong
    2<-2 3<-70% 5<-50% stands for ? :

    • if 1 or 2 terms match 100% of them
    • if 3 to 4 match only 70% of them
    • if 5 or more match only 50%
  • ps : what is this param? Is it mandatory ?

  • q.alt : the same i did not understand the utility of that one.

Can you provide me some advise for the best configuration of DisMax ?

Thank you !

like image 548
Joe Avatar asked Sep 02 '10 15:09

Joe


People also ask

What is DisMax in Solr?

The DisMax query parser is designed to process simple phrases (without complex syntax) entered by users and to search for individual terms across several fields using different weighting (boosts) based on the significance of each field.

What is Q in Solr query?

Solr provides Query (q parameter) and Filter Query (fq parameter) for searching. The query (q parameter), as the name suggests, is the main query used for searching. Example. q = title:james. Filter queries are used alongside query (q parameter) to limit results of queries using additional filters.

How do I query in Solr admin?

You can search for "solr" by loading the Admin UI Query tab, enter "solr" in the q param (replacing *:* , which matches all documents), and "Execute Query". See the Searching section below for more information. To index your own data, re-run the directory indexing command pointed to your own directory of documents.

What is the default return type of Solr request?

The default value is 0 . In other words, by default, Solr returns results without an offset, beginning where the results themselves begin.


1 Answers

1: Your string would translate to

1-2 terms: match all terms
3 terms: total number of terms - 2 must match (i.e. 1 term must match :)
4-5 terms: 70% of the terms must match 
6+ terms: 50% of the terms must match

mm-string to achieve your requirement would be

2<%70 4<%50

A very good resource for mm strings can be found here.

2: The pf parameter is used to boost document relevance based on query terms occurring in close proximity of each other (as opposed to being scattered all over the document).

3: The q.alt parameter is used as a fallback query for cases when the client did not provide any search terms. In my interpretation, it is meant for use if you don't do any client-side query processing/transformation, but there could be other practical uses for it.

like image 184
Karl Johansson Avatar answered Sep 24 '22 00:09

Karl Johansson