php8.5
Home/ Manual/ solr / solrdismaxquery/ SolrDisMaxQuery::setQueryPhraseSlop

SolrDisMaxQuery::setQueryPhraseSlop

PHP function Edit on GitHub ✎

Specifies the amount of slop permitted on phrase queries explicitly included in the user's query string (qf parameter)

Description

SolrDisMaxQuery::setQueryPhraseSlop(string $slop): SolrDisMaxQuery

The Query Phrase Slop is the amount of slop permitted on phrase queries explicitly included in the user's query string with the qf parameter.

slop refers to the number of positions one token needs to be moved in relation to another token in order to match a phrase specified in a query.

Parameters

slop

Amount of slop

Return Values

SolrDisMaxQuery

Examples

SolrDisMaxQuery::setQueryPhraseSlop() example

php
<?php

$dismaxQuery = new SolrDisMaxQuery();
$dismaxQuery->setQueryPhraseSlop(3);
echo $dismaxQuery;
?>

The above example will output something similar to:

output
defType=edismax&qs=3

Source: reference/solr/solrdismaxquery/setqueryphraseslop.xml · from the official PHP manual (php/doc-en)