Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]

### Added
- Implementation of SLOP parameter

- Implementation of SLOP parameter ([PR#8])

### Fixed

- Correclty handle Search result with NoContent flag ([Issue#9], [Issue#10], [PR#13])

## [1.3.0]

Expand Down Expand Up @@ -101,5 +106,9 @@ First version
[1.0.0]: https://github.com/MacFJA/php-redisearch/releases/tag/1.0.0

[Issue#2]: https://github.com/MacFJA/php-redisearch/issues/2
[Issue#9]: https://github.com/MacFJA/php-redisearch/issues/9
[Issue#10]: https://github.com/MacFJA/php-redisearch/issues/10
[PR#1]: https://github.com/MacFJA/php-redisearch/pull/1
[PR#3]: https://github.com/MacFJA/php-redisearch/pull/3
[PR#3]: https://github.com/MacFJA/php-redisearch/pull/3
[PR#8]: https://github.com/MacFJA/php-redisearch/pull/8
[PR#13]: https://github.com/MacFJA/php-redisearch/pull/13
14 changes: 9 additions & 5 deletions src/Search.php
Original file line number Diff line number Diff line change
Expand Up @@ -457,12 +457,15 @@ static function ($rawResult, array $context): PaginatedResult {
$payload = ($context['payloads'] ?? false) ? array_shift($document) : null;
$sortKey = ($context['sortKeys'] ?? false) ? array_shift($document) : null;

if (!(1 === count($document))) {
throw new InvalidArgumentException();
$fields = [];
if (false === $context['noContent']) {
if (!(1 === count($document))) {
throw new InvalidArgumentException();
}
$rawData = reset($document);
assert(is_array($rawData));
$fields = RedisHelper::getPairs($rawData);
}
$rawData = reset($document);
assert(is_array($rawData));
$fields = RedisHelper::getPairs($rawData);

return new Result($hash, $fields, $score, $payload, $sortKey);
}, $documents);
Expand All @@ -476,6 +479,7 @@ static function ($rawResult, array $context): PaginatedResult {
'scores' => $this->withScores,
'payloads' => $this->withPayloads,
'sortKeys' => $this->withSortKeys,
'noContent' => $this->noContent,
]
);
} finally {
Expand Down