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

SolrDisMaxQuery::setPhraseSlop

PHP function Edit on GitHub ✎

Sets the default slop on phrase queries (ps parameter)

Description

SolrDisMaxQuery::setPhraseSlop(string $slop): SolrDisMaxQuery

Sets the default amount of slop on phrase queries built with "pf", "pf2" and/or "pf3" fields (affects boosting). "ps" parameter

Parameters

slop

Return Values

SolrDisMaxQuery

Examples

SolrDisMaxQuery::setPhraseSlop() example

php
<?php

$dismaxQuery = new SolrDisMaxQuery('lucene');

$dismaxQuery->setPhraseSlop(4);
echo $dismaxQuery.PHP_EOL;

?>

The above example will output:

output
q=lucene&defType=edismax&ps=4

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