Skip to content

Commit

Permalink
Merge pull request solariumphp#439 from haydenyoung/solariumphp#426
Browse files Browse the repository at this point in the history
Do not parse collation array for Solr 5+; values are already in name/value pairs. Change unit test to match the collation data structure returned by Solr.
  • Loading branch information
basdenooijer authored Jul 1, 2016
2 parents b085cc1 + e2063db commit 926e0b5
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 16 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# CHANGELOG


## 3.6.0
## 3.6.0 - 2016-05-03

- improvement: no longer allow failures for HHVM in continuous integration
- improvement: added Symfony 3.x components to CI tests for PHP 5.5+
Expand Down
2 changes: 1 addition & 1 deletion library/Solarium/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class Client extends CoreClient
*
* @var string
*/
const VERSION = '3.4.0';
const VERSION = '3.6.0';

/**
* Check for an exact version.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,18 @@ protected function parseCollation($queryObject, $values)
if ($queryObject->getResponseWriter() == $queryObject::WT_JSON) {
if (is_array(current($values))) {
foreach ($values as $key => $value) {
$values[$key] = $this->convertToKeyValueArray($value);
if (array_key_exists('collationQuery', $value)) {
$values[$key] = $value;
} else {
$values[$key] = $this->convertToKeyValueArray($value);
}
}
} else {
$values = array($this->convertToKeyValueArray($values));
if (array_key_exists('collationQuery', $values)) {
$values = array($values);
} else {
$values = array($this->convertToKeyValueArray($values));
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,12 +194,9 @@ public function providerParseExtended()
'collations' => array(
'collation',
array(
0 => 'collationQuery',
1 => 'dell ultrasharp',
2 => 'hits',
3 => 0,
4 => 'misspellingsAndCorrections',
5 => array(
'collationQuery' => 'dell ultrasharp',
'hits' => 0,
'misspellingsAndCorrections' => array(
0 => 'delll',
1 => 'dell',
2 => 'ultrashar',
Expand All @@ -208,12 +205,9 @@ public function providerParseExtended()
),
'collation',
array(
0 => 'collationQuery',
1 => 'dell ultrasharp new',
2 => 'hits',
3 => 0,
4 => 'misspellingsAndCorrections',
5 => array(
'collationQuery' => 'dell ultrasharp new',
'hits' => 0,
'misspellingsAndCorrections' => array(
0 => 'delll',
1 => 'dell',
2 => 'ultrashar',
Expand Down

0 comments on commit 926e0b5

Please sign in to comment.