File: 116.solrdismaxquery_boostfunction.phpt

package info (click to toggle)
php-solr 2.4.0-4
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 2,420 kB
  • ctags: 2,794
  • sloc: ansic: 26,401; php: 1,152; xml: 1,126; pascal: 4; makefile: 1
file content (15 lines) | stat: -rw-r--r-- 341 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
--TEST--
SolrDisMaxQuery - setBoostFunction
--FILE--
<?php

$dismaxQuery = new SolrDisMaxQuery('lucene');

$boostRecentDocsFunction = "recip(ms(NOW,mydatefield),3.16e-11,1,1)";
$dismaxQuery->setBoostFunction($boostRecentDocsFunction);

echo $dismaxQuery.PHP_EOL;

?>
--EXPECTF--
q=lucene&defType=%s&bf=recip(ms(NOW,mydatefield),3.16e-11,1,1)