File: 111.solrdismaxquery_boostquery.phpt

package info (click to toggle)
php-solr 2.8.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,620 kB
  • sloc: ansic: 14,274; xml: 1,313; php: 1,239; pascal: 11; makefile: 3
file content (25 lines) | stat: -rw-r--r-- 681 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
--TEST--
SolrDisMaxQuery - Boost Query
--FILE--
<?php

$dismaxQuery = new SolrDisMaxQuery("lucene");
$dismaxQuery
	->addBoostQuery('cat', 'electronics', 5.1)
	->addBoostQuery('cat', 'hard drive')
;
// reverse
echo $dismaxQuery.PHP_EOL;
$dismaxQuery
->removeBoostQuery('cat');
echo $dismaxQuery.PHP_EOL;

$dismaxQuery->setBoostQuery('cat:electronics manu:local^2');
echo $dismaxQuery.PHP_EOL;
?>
--EXPECTF--
q=lucene&defType=edismax&bq=cat:electronics^5.1 cat:hard drive
q=lucene&defType=edismax&bq=cat:hard drive

Notice: SolrDisMaxQuery::setBoostQuery(): Parameter bq value(s) was overwritten by this call in %s on line %d
q=lucene&defType=edismax&bq=cat:electronics manu:local^2