11.05.2016 Views

Apache Solr Reference Guide Covering Apache Solr 6.0

21SiXmO

21SiXmO

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

paging, and filtering using common query parameters, but does not work well with alternate query parsers.<br />

Parameter<br />

mlt.match.include<br />

mlt.match.offset<br />

Description<br />

Specifies whether or not the response should include the matched document. If set to<br />

false, the response will look like a normal select response.<br />

Specifies an offset into the main query search results to locate the document on which<br />

the MoreLikeThis query should operate. By default, the query operates on the first<br />

result for the q parameter.<br />

mlt.interestingTerms Controls how the MoreLikeThis component presents the "interesting" terms (the top<br />

TF/IDF terms) for the query. Supports three settings. The setting list lists the terms. The<br />

setting none lists no terms. The setting details lists the terms along with the boost value<br />

used for each term. Unless mlt.boost=true, all terms will have boost=1.0.<br />

More Like This Query Parser<br />

The mlt query parser provides a mechanism to retrieve documents similar to a given document, like the handler.<br />

More information on the usage of the mlt query parser can be found here.<br />

Related Topics<br />

RequestHandlers and SearchComponents in <strong>Solr</strong>Config<br />

Pagination of Results<br />

Basic Pagination<br />

In most search application usage, the "top" matching results (sorted by score, or some other criteria) are then<br />

displayed to some human user. In many applications the UI for these sorted results are displayed to the user in<br />

"pages" containing a fixed number of matching results, and users don't typically look at results past the first few<br />

pages worth of results.<br />

In <strong>Solr</strong>, this basic paginated searching is supported using the start and rows parameters, and performance of<br />

this common behaviour can be tuned by utilizing the queryResultCache and adjusting the queryResultWin<br />

dowSize configuration options based on your expected page sizes.<br />

Basic Pagination Examples<br />

The easiest way to think about simple pagination, is to simply multiply the page number you want (treating the<br />

"first" page number as "0") by the number of rows per page; such as in the following psuedo-code:<br />

function fetch_solr_page($page_number, $rows_per_page) {<br />

$start = $page_number * $rows_per_page<br />

$params = [ q = $some_query, rows = $rows_per_page, start = $start ]<br />

return fetch_solr($params)<br />

}<br />

<strong>Apache</strong> <strong>Solr</strong> <strong>Reference</strong> <strong>Guide</strong> <strong>6.0</strong><br />

347

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!