ÿØÿà JFIF      ÿÛ „ 	 ( %!1!%)+//.383,7(-.+



-%%-////---/-.+/--+------/------/--0+--/-/-----.-----ÿÀ  ¥2" ÿÄ               ÿÄ J  	     ! 1AQ"aq2‘#BR‚¡ÁÑ3br’¢±Âð$CSƒ²á4c“%DsÓñÿÄ              ÿÄ *        !1AQa‘"2q3±ð#b¡ÿÚ   ? ¼QxJQaÍuò¸Zö Úü8,ÐÚú
"SSn<rçù–´âE—^ªBÖ9À\†¸ÔÁT­ÃÛ5
ëd´³Í#Ý;Þ38œî ¶H£M:wÎ3…³…âpÔF&‚FK¸9„â4àGEõªfÿ ‘ñ(ßw­pŽF|È¥ù®häðÍÑ¶¹‘[ÒinÙW¶ùñY˜Q{›K"išÒ[Ú8žë\F¹@-?v"ÔU”,ìöžkÿ {I‡£šÍ?e
ríV
..............................................................................................................................................................................
.............................................................................                                                  
                                                                                                                                                                                     ÿØÿà JFIF      ÿÛ „ 	 ( %!1!%)+//.383,7(-.+



-%%-////---/-.+/--+------/------/--0+--/-/-----.-----ÿÀ  ¥2" ÿÄ               ÿÄ J  	     ! 1AQ"aq2‘#BR‚¡ÁÑ3br’¢±Âð$CSƒ²á4c“%DsÓñÿÄ              ÿÄ *        !1AQa‘"2q3±ð#b¡ÿÚ   ? ¼QxJQaÍuò¸Zö Úü8,ÐÚú
"SSn<rçù–´âE—^ªBÖ9À\†¸ÔÁT­ÃÛ5
ëd´³Í#Ý;Þ38œî ¶H£M:wÎ3…³…âpÔF&‚FK¸9„â4àGEõªfÿ ‘ñ(ßw­pŽF|È¥ù®häðÍÑ¶¹‘[ÒinÙW¶ùñY˜Q{›K"išÒ[Ú8žë\F¹@-?v"ÔU”,ìöžkÿ {I‡£šÍ?e
ríV
..............................................................................................................................................................................
.............................................................................                                                  
                                                                                                                                                                                     --TEST--
Solr Bug #72740 - addPhraseField return wrong query
--SKIPIF--
<?php require_once 'skip.if.server_not_configured.inc'; ?>
--FILE--
<?php

require_once "bootstrap.inc";

$options = array (
		'hostname' => SOLR_SERVER_HOSTNAME,
		'login' => SOLR_SERVER_USERNAME,
		'password' => SOLR_SERVER_PASSWORD,
		'port' => SOLR_SERVER_PORT,
		'path' => SOLR_SERVER_PATH
);

$client = new SolrClient( $options );

$dismaxQuery = new SolrDisMaxQuery( '*:*' );
$dismaxQuery->addPhraseField( "phraseField1", 10, 5 );
$dismaxQuery->addPhraseField( "phraseField2", 5, 1 );
$dismaxQuery->addSortField('score', SolrQuery::ORDER_DESC);
$dismaxQuery->addSortField('manufacturedate_dt', SolrQuery::ORDER_DESC);

// Scenario 1: DisMax Query Parser - Adds Phrase Fields with both boost and slop.
// Expect:
// - pf parameter should list each phrase field with ~ and ^ prefix for slop and boost value respectively.
$queryResponse = $client->query( $dismaxQuery );

print_r($queryResponse->getResponse()->responseHeader->params);

// Scenario 2: Same as Scenario 1, now including explicit query fields too.
// Expect:
// - pf parameter should list each phrase field with ~ and ^ prefix for slop and boost value respectively.
// - qf parameter should list each query field with a trailing ^ (no boost here).
$dismaxQuery->addQueryField('score');
$dismaxQuery->addQueryField('manufacturedate_dt');

$queryResponse = $client->query( $dismaxQuery );

print_r($queryResponse->getResponse()->responseHeader->params);

// Scenario 3: Same as Scenario 2, now including explicit boost value for the query fields.
// Expect:
// - pf parameter should list each phrase field with ~ and ^ prefix for slop and boost value respectively.
// - qf parameter should list each query field with a ^ prefix for boost value.
$dismaxQuery->removeQueryField('score');
$dismaxQuery->removeQueryField('manufacturedate_dt');
$dismaxQuery->addQueryField('score', 3);
$dismaxQuery->addQueryField('manufacturedate_dt', 7);

$queryResponse = $client->query( $dismaxQuery );

print_r($queryResponse->getResponse()->responseHeader->params);
?>
--EXPECTF--
SolrObject Object
(
    [q] => *:*
    [defType] => edismax
    [indent] => on
    [pf] => phraseField1~5^10 phraseField2~1^5
    [sort] => score desc,manufacturedate_dt desc
    [version] => 2.2
    [wt] => xml
)
SolrObject Object
(
    [q] => *:*
    [defType] => edismax
    [indent] => on
    [qf] => score^ manufacturedate_dt^
    [pf] => phraseField1~5^10 phraseField2~1^5
    [sort] => score desc,manufacturedate_dt desc
    [version] => 2.2
    [wt] => xml
)
SolrObject Object
(
    [q] => *:*
    [defType] => edismax
    [indent] => on
    [qf] => score^3 manufacturedate_dt^7
    [pf] => phraseField1~5^10 phraseField2~1^5
    [sort] => score desc,manufacturedate_dt desc
    [version] => 2.2
    [wt] => xml
)