Decoding the Solr More Like This Query Parameters

This section details the query parameters that are sent through to the Solr server when a More Like This query is performed, what they mean and the Panl properties which may affect the implementation.

Both of the implementations included in the Panl server will generate Solr queries with predominantly the same parameters, however their format is different.

The main difference is that the MoreLikeThis Request Handler passes every parameter through as a URL query parameter, whilst the MoreLikeThis Query Parser encodes the parameters within curly braces - i.e. '{}', delimited by spaces

MoreLikeThis Request Handler

For the request handler, the query string will be of the form:

mlt=true&qt=/mlt&mlt.fl=title,author,series,genre&mlt.mintf=0&mlt.mindf=0&q=id:2&ml
t.minwl=0&mlt.interestingTerms=none&mlt.match.include=false&shards=shard1&shards.pr
eference=replica.location:local&rows=5&fl=id,author,title,genre,series

MoreLikeThis Query Parser

For the query parser, the query string will be of the form:

qt=/select&q={!mlt+qf=title,author,series,genre+mintf=0 mindf=0 minwl=0}2&rows=5&fl
=id,author,title,genre,series

Translating The Parameters

The MLT Request Handler passes through the URL key value pair parameters prefixed with mlt., where the Query Parser encodes the parameters into the query parameter (i.e. 'q').



Image: The Mapping of parameters between the Request Handler and the Query Parser.

Query Parameter Mapping and Availability

Panl configuration parameter

Request Handler

Query Parser

Notes

panl.mlt.enable

true

true

Must be set to true to enable MLT functionality

panl.mlt.handler

/mlt

/select

Can be configured to any of the Solr handlers which are defined.

panl.mlt.type

mlt

select

Can only be one of the two values.

panl.mlt.numretries

6

N/A

Only applicable to the Request Handler, will be ignored for the Query Parser

Panl configuration parameter

Request Handler URL Parameter

Query Parser Equivalent URL Parameter

panl.mlt.fl

mlt.fl

N/A (use panl.mlt.qf instead)

panl.mlt.mintf

mlt.mintf

mintf

panl.mlt.mindf

mlt.mindf

mindf

panl.mlt.mindf

mlt.maxdf

maxdf

panl.mlt.maxdfpct

mlt.maxdfpct

N/A

panl.mlt.minwl

mlt.minwl

minwl

panl.mlt.maxwl

mlt.maxwl

maxwl

panl.mlt.maxqt

mlt.maxqt

maxqt

panl.mlt.maxntp

mlt.maxntp

maxntp

panl.mlt.boost

mlt.boost

boost

panl.mlt.qf

N/A (use panl.mlt.fl instead)

qf 

panl.mlt.interestingTerms

mlt.interestingTerms

N/A

panl.mlt.match.include

mlt.match.include

N/A

panl.mlt.match.offset

mlt.match.offset

N/A

qt=

This is the query handler that the Solr server will use to handle the incoming request.

If not set, it defaults to /select - and in the previous section on decoding the Solr query parameters, this is not included as a parameter and uses this default).  

MoreLikeThis Request Handler

In the request handler, the qt parameter is set to /mlt which will hit the defined Solr MoreLikeThis Request Handler at the URL:

http://localhost:8983/solr/book-store/mlt?mlt=true&mlt.fl=title,author,series,genre&mlt.mintf=0&mlt.mindf=0&q=id:2&mlt.minwl=0&mlt.interestingTerms=none&mlt.match.include=false&shards=shard1&shards.preference=replica.location:local&rows=5&fl=id,author,title,genre,series

MoreLikeThis Query Parser

For the query parser implementation, it is explicitly set, although not necessary.  This was implemented in case a separate select query handler was registered and used.  This will translate[51] to the URL of:

http://localhost:8983/solr/book-store/select?q={!mlt+qf=title,author%20mintf=0%20mindf=0%20minwl=0%20maxntp=0}2&rows=5&fl=id,author,title,genre,series

q=

This is the Solr query parameter - i.e. the keyword search parameter

MoreLikeThis Request Handler

The query will ALWAYS be the Solr unique key field (in this instance id) and the value of the unique Solr document id.

MoreLikeThis Query Parser

The query is specially formulated inside curly braces with all of the options without the mlt. query parameter prefix.

~ ~ ~ * ~ ~ ~