Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GeoBoundingBoxCondition #420

Merged
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Mark RediSearch as not supported
alexander-schranz committed Sep 20, 2024
commit 3782070fcf70117c560a4b6db743dfbe19c06c94
5 changes: 5 additions & 0 deletions docs/search-and-filters/index.rst
Original file line number Diff line number Diff line change
@@ -223,6 +223,11 @@ The ``GeoBoundingBoxCondition`` is used to filter results within a bounding box
The field is required to be marked as ``filterable`` in the index configuration.

.. note::

The ``GeoBoundingBoxCondition`` is currently not supported by ``Redisearch`` adapter.
See `this Github Issue <https://github.com/RediSearch/RediSearch/issues/680>`__ for more information.

Filter on Objects and Typed Fields
----------------------------------

3 changes: 3 additions & 0 deletions packages/seal-redisearch-adapter/src/RediSearchSearcher.php
Original file line number Diff line number Diff line change
@@ -97,6 +97,8 @@ public function search(Search $search): Result
$filter->latitude,
($filter->distance / 1000) . ' km',
),
$filter instanceof Condition\GeoBoundingBoxCondition => throw new \RuntimeException('Not supported by RediSearch: https://github.com/RediSearch/RediSearch/issues/680 or https://github.com/RediSearch/RediSearch/issues/5032');
/* Keep here for future implementation:
$filter instanceof Condition\GeoBoundingBoxCondition => ($filters[] = \sprintf(
'@%s:[WITHIN $filter_%s]',
$this->getFilterField($search->indexes, $filter->field),
@@ -114,6 +116,7 @@ public function search(Search $search): Result
$filter->westLongitude,
$filter->northLatitude,
)),
*/
default => throw new \LogicException($filter::class . ' filter not implemented.'),
};
}
Original file line number Diff line number Diff line change
@@ -33,4 +33,12 @@ public function testFindMultipleIndexes(): void
{
$this->markTestSkipped('Not supported by RediSearch: https://github.com/schranz-search/schranz-search/issues/93');
}

/**
* @doesNotPerformAssertions
*/
public function testGeoBoundingBoxCondition(): void
{
$this->markTestSkipped('Not supported by RediSearch: https://github.com/RediSearch/RediSearch/issues/680 or https://github.com/RediSearch/RediSearch/issues/5032');
}
}