简体   繁体   中英

Solr - mm paramter of dismax parser

I am using Solr 5.2.1, in one of my project, and got some doubt on mm paramter of dismax / edismax parser.

Questions:

  • Does mm regardless of total input term count? Document says yes, but when I set it to 3, and input a single term, it still could get records, so it seems not regardless of total input term count.
  • What is the default value of mm ? Document says it's 100% , but in my query test, it seems to be 1 . By the way, I didn't found configuration for mm in solrconfig.xml or schema.xml .

Any help? Thx.


@Update:

Query url for 1st question:

http://localhost:8983/solr/demo/select?q=new+york&start=0&wt=json&indent=true&defType=edismax&qf=title&mm=3&stopwords=true&lowercaseOperators=true

There are 2 terms new and york , the query result is:

  • don't specify mm , return 3 records,
  • mm = 2, return 1 records,
  • mm = 3, also return 1 records,

So, I guess it will change the mm to max term first, before query.

Answer-2: If no mm parameter is specified in the query, or as a default in solrconfig.xml , the effective value of the q.op parameter (either in the query, as a default in solrconfig.xml, or from the 'defaultOperator' option in schema.xml) is used to influence the behavior. So the default behavior of the mm is determined by q.op parameter. If q.op is effectively AND , then mm=100% ; if q.op is OR , then mm=1 .

From the Min Number Should Match Specification Format :

No matter what number the calculation arrives at, a value greater than the number of optional clauses, or a value less than 1 will never be used. (ie: no matter how low or how high the result of the calculation result is, the minimum number of required matches will never be lower than 1 or greater than the number of clauses .

Meaning that the required number will never be less than one, or greater than the number of terms present in the query. If there are three terms in the query and the mm factor is five, it'll still produce a match as the number of terms are less than the required optional terms to match. All terms matching will always give a hit, as it's otherwise just zero matches for everything with less than x query terms.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM