diff --git a/src/Dto/Search/Query/Facet/SpatialDistanceRangeFacet.php b/src/Dto/Search/Query/Facet/SpatialDistanceRangeFacet.php new file mode 100644 index 0000000..40d8ed2 --- /dev/null +++ b/src/Dto/Search/Query/Facet/SpatialDistanceRangeFacet.php @@ -0,0 +1,23 @@ +distanceReferencePoint = $distanceReferencePoint; + return $this; + } + public function explain( bool $explain, ): static { @@ -191,6 +200,7 @@ public function build(): SearchQuery defaultQueryOperator: $this->defaultQueryOperator, timeZone: $this->timeZone, boosting: $this->boosting, + distanceReferencePoint: $this->distanceReferencePoint, explain: $this->explain, ); } diff --git a/src/Dto/Search/Query/Sort/SpatialDist.php b/src/Dto/Search/Query/Sort/SpatialDist.php new file mode 100644 index 0000000..9b00296 --- /dev/null +++ b/src/Dto/Search/Query/Sort/SpatialDist.php @@ -0,0 +1,20 @@ +getGeoPointField(); default: throw new InvalidArgumentException( - 'Unsupported filter-field-class ' . get_class($facet), + 'Unsupported filter-field-class ' . get_class($filter), ); } } @@ -99,6 +111,13 @@ public function getSortField(Criteria $criteria): string return 'sp_sortvalue'; case $criteria instanceof Score: return 'score'; + case $criteria instanceof SpatialDist: + $params = [ + $this->getGeoPointField(), + $criteria->point->lat, + $criteria->point->lng, + ]; + return 'geodist(' . implode(',', $params) . ')'; case $criteria instanceof CustomField: return $criteria->field; default: diff --git a/src/Service/Search/SolrQueryFacetAppender.php b/src/Service/Search/SolrQueryFacetAppender.php index 96858cb..d050930 100644 --- a/src/Service/Search/SolrQueryFacetAppender.php +++ b/src/Service/Search/SolrQueryFacetAppender.php @@ -10,6 +10,7 @@ use Atoolo\Search\Dto\Search\Query\Facet\MultiQueryFacet; use Atoolo\Search\Dto\Search\Query\Facet\QueryFacet; use Atoolo\Search\Dto\Search\Query\Facet\RelativeDateRangeFacet; +use Atoolo\Search\Dto\Search\Query\Facet\SpatialDistanceRangeFacet; use InvalidArgumentException; use Solarium\Component\Facet\Field; use Solarium\QueryType\Select\Query\Query as SolrSelectQuery; @@ -33,6 +34,9 @@ public function append(Facet $facet): void $this->appendAbsoluteDateRangeFacet($facet); } elseif ($facet instanceof RelativeDateRangeFacet) { $this->appendRelativeDateRangeFacet($facet); + } elseif ($facet instanceof SpatialDistanceRangeFacet) { + $this->appendGeoDistanceRangeFacet($facet); + } else { throw new InvalidArgumentException( 'Unsupported facet-class ' . get_class($facet), @@ -100,6 +104,24 @@ private function appendAbsoluteDateRangeFacet( $this->appendFacetRange($facet, $start, $end, $gap); } + private function appendGeoDistanceRangeFacet( + SpatialDistanceRangeFacet $facet, + ): void { + + $params = [ + $this->fieldMapper->getGeoPointField(), + $facet->point->lat, + $facet->point->lng, + ]; + + $facetQuery = new QueryFacet( + $facet->key, + '{!frange l=' . $facet->from . ' u=' . $facet->to . '}geodist(' . implode(',', $params) . ')', + $facet->excludeFilter, + ); + $this->appendFacetQuery($facetQuery); + } + private function appendRelativeDateRangeFacet( RelativeDateRangeFacet $facet, ): void { diff --git a/src/Service/Search/SolrQueryFilterAppender.php b/src/Service/Search/SolrQueryFilterAppender.php index 0dd49a5..0428415 100644 --- a/src/Service/Search/SolrQueryFilterAppender.php +++ b/src/Service/Search/SolrQueryFilterAppender.php @@ -6,13 +6,15 @@ use Atoolo\Search\Dto\Search\Query\Filter\AbsoluteDateRangeFilter; use Atoolo\Search\Dto\Search\Query\Filter\AndFilter; -use Atoolo\Search\Dto\Search\Query\Filter\ArchiveFilter; use Atoolo\Search\Dto\Search\Query\Filter\FieldFilter; use Atoolo\Search\Dto\Search\Query\Filter\Filter; use Atoolo\Search\Dto\Search\Query\Filter\NotFilter; use Atoolo\Search\Dto\Search\Query\Filter\OrFilter; use Atoolo\Search\Dto\Search\Query\Filter\QueryFilter; use Atoolo\Search\Dto\Search\Query\Filter\RelativeDateRangeFilter; +use Atoolo\Search\Dto\Search\Query\Filter\SpatialArbitraryRectangleFilter; +use Atoolo\Search\Dto\Search\Query\Filter\SpatialOrbitalFilter; +use Atoolo\Search\Dto\Search\Query\Filter\SpatialOrbitalMode; use InvalidArgumentException; use Solarium\QueryType\Select\Query\Query as SolrSelectQuery; @@ -29,12 +31,13 @@ public function excludeArchived(): void $field = $this->fieldMapper->getArchiveField(); $filterQuery->setQuery('-' . $field . ':true'); } + public function append(Filter $filter): void { $key = $filter->key ?? uniqid('', true); $filterQuery = $this->solrQuery->createFilterQuery($key); $filterQuery->setQuery($this->getQuery($filter)); - $filterQuery->setTags($filter->tags); + $filterQuery->setTags(array_merge($filter->tags, [$key])); } private function getQuery(Filter $filter): string @@ -54,6 +57,10 @@ private function getQuery(Filter $filter): string return $this->getAbsoluteDateRangeQuery($filter); case $filter instanceof RelativeDateRangeFilter: return $this->getRelativeDateRangeQuery($filter); + case $filter instanceof SpatialOrbitalFilter: + return $this->getSpatialOrbitalQuery($filter); + case $filter instanceof SpatialArbitraryRectangleFilter: + return $this->getSpatialArbitraryRectangleQuery($filter); default: throw new InvalidArgumentException( 'unsupported filter ' . get_class($filter), @@ -116,7 +123,7 @@ private function getRelativeDateRangeQuery( } else { $from = SolrDateMapper::roundStart( SolrDateMapper::mapDateTime($filter->base) . - SolrDateMapper::mapDateInterval($filter->before, '-'), + SolrDateMapper::mapDateInterval($filter->before, '-'), $filter->roundStart, ); } @@ -129,7 +136,7 @@ private function getRelativeDateRangeQuery( } else { $to = SolrDateMapper::roundEnd( SolrDateMapper::mapDateTime($filter->base) . - SolrDateMapper::mapDateInterval($filter->after, '+'), + SolrDateMapper::mapDateInterval($filter->after, '+'), $filter->roundEnd, ); } @@ -138,4 +145,42 @@ private function getRelativeDateRangeQuery( return $field . ':[' . $from . ' TO ' . $to . ']'; } + + private function getSpatialOrbitalQuery( + SpatialOrbitalFilter $filter, + ): string { + + $field = $this->getFilterField($filter); + $params = [ + 'sfield=' . $field, + 'pt=' . $filter->centerPoint->lat . ',' . $filter->centerPoint->lng, + 'd=' . $filter->distance, + ]; + + if ($filter->mode === SpatialOrbitalMode::GREAT_CIRCLE_DISTANCE) { + return '{!geofilt ' . implode(' ', $params) . '}'; + } + + if ($filter->mode === SpatialOrbitalMode::BOUNDING_BOX) { + return '{!bbox ' . implode(' ', $params) . '}'; + } + } + + private function getSpatialArbitraryRectangleQuery( + SpatialArbitraryRectangleFilter $filter, + ): string { + + $field = $this->getFilterField($filter); + + return $field + . ':[ ' + . $filter->lowerLeftCorner->lat + . ',' + . $filter->lowerLeftCorner->lng + . ' TO ' + . $filter->upperRightCorner->lat + . ',' + . $filter->upperRightCorner->lng + . ' ]'; + } } diff --git a/src/Service/Search/SolrResultToResourceResolver.php b/src/Service/Search/SolrResultToResourceResolver.php index 1d8f8af..a3f675b 100644 --- a/src/Service/Search/SolrResultToResourceResolver.php +++ b/src/Service/Search/SolrResultToResourceResolver.php @@ -55,13 +55,11 @@ private function createResource( ResourceLanguage $lang, ): Resource { $resource = $this->loadResource($document, $lang); - $explain = $document->getFields()['explain'] ?? []; - if (!empty($explain)) { - $explain = $this->explainBuilder->build($explain); + $dataExtensions = $this->extendResourceData($document); + if (!empty($dataExtensions)) { $rawData = $resource->data->get(); - $rawData['explain'] = $explain; - + $rawData = array_merge_recursive($rawData, $dataExtensions); return new Resource( $resource->location, $resource->id, @@ -74,6 +72,33 @@ private function createResource( return $resource; } + /** + * @return array{ + * base?: array{ + * geo?: array{ + * distance?: float + * } + * }, + * explain?: array + * } + */ + private function extendResourceData(Document $document): array + { + + $dataExtensions = []; + $explain = $document->getFields()['explain'] ?? []; + if (!empty($explain)) { + $explain = $this->explainBuilder->build($explain); + $dataExtensions['explain'] = $explain; + } + + $distance = $document->getFields()['distance'] ?? null; + if ($distance !== null) { + $dataExtensions['base']['geo']['distance'] = $distance; + } + return $dataExtensions; + } + private function loadResource( Document $document, ResourceLanguage $lang, diff --git a/src/Service/Search/SolrSearch.php b/src/Service/Search/SolrSearch.php index 0dee63d..583bc86 100644 --- a/src/Service/Search/SolrSearch.php +++ b/src/Service/Search/SolrSearch.php @@ -7,6 +7,7 @@ use Atoolo\Resource\ResourceLanguage; use Atoolo\Search\Dto\Search\Query\Boosting; use Atoolo\Search\Dto\Search\Query\Filter\Filter; +use Atoolo\Search\Dto\Search\Query\GeoPoint; use Atoolo\Search\Dto\Search\Query\QueryOperator; use Atoolo\Search\Dto\Search\Query\SearchQuery; use Atoolo\Search\Dto\Search\Query\Sort\Criteria; @@ -97,6 +98,7 @@ private function buildSolrQuery( $solrQuery, $query->facets, ); + $this->addDistanceField($solrQuery, $query->distanceReferencePoint); if ($query->timeZone !== null) { $solrQuery->setTimezone($query->timeZone); @@ -123,6 +125,7 @@ private function addSortToSolrQuery( $direction = strtolower($criteria->direction->name); $sorts[$field] = $direction; } + $solrQuery->setSorts($sorts); } @@ -217,6 +220,21 @@ private function addFilterQueriesToSolrQuery( } } + private function addDistanceField( + SolrSelectQuery $solrQuery, + ?GeoPoint $distanceReferencePoint, + ): void { + if ($distanceReferencePoint === null) { + return; + } + $params = [ + $this->schemaFieldMapper->getGeoPointField(), + $distanceReferencePoint->lat, + $distanceReferencePoint->lng, + ]; + $solrQuery->addField('distance:geodist(' . implode(',', $params) . ')'); + } + /** * @param \Atoolo\Search\Dto\Search\Query\Facet\Facet[] $facetList */ diff --git a/test/Dto/Search/Query/SearchQueryBuilderTest.php b/test/Dto/Search/Query/SearchQueryBuilderTest.php index d8ec2a8..dff2c95 100644 --- a/test/Dto/Search/Query/SearchQueryBuilderTest.php +++ b/test/Dto/Search/Query/SearchQueryBuilderTest.php @@ -8,6 +8,7 @@ use Atoolo\Search\Dto\Search\Query\Boosting; use Atoolo\Search\Dto\Search\Query\Facet\Facet; use Atoolo\Search\Dto\Search\Query\Filter\Filter; +use Atoolo\Search\Dto\Search\Query\GeoPoint; use Atoolo\Search\Dto\Search\Query\QueryOperator; use Atoolo\Search\Dto\Search\Query\SearchQueryBuilder; use Atoolo\Search\Dto\Search\Query\Sort\Criteria; @@ -170,6 +171,18 @@ public function testSetBoosting(): void ); } + public function testSetDistanceReferencePoint(): void + { + $point = new GeoPoint(1, 2); + $this->builder->distanceReferencePoint($point); + $query = $this->builder->build(); + $this->assertSame( + $point, + $query->distanceReferencePoint, + 'unexpected distanceReferencePoint', + ); + } + public function testSetExplain(): void { $this->builder->explain(true); diff --git a/test/Service/Search/Schema2xFieldMapperTest.php b/test/Service/Search/Schema2xFieldMapperTest.php index 81aa5c7..2c73c2a 100644 --- a/test/Service/Search/Schema2xFieldMapperTest.php +++ b/test/Service/Search/Schema2xFieldMapperTest.php @@ -13,7 +13,6 @@ use Atoolo\Search\Dto\Search\Query\Facet\RelativeDateRangeFacet; use Atoolo\Search\Dto\Search\Query\Facet\SiteFacet; use Atoolo\Search\Dto\Search\Query\Filter\AbsoluteDateRangeFilter; -use Atoolo\Search\Dto\Search\Query\Filter\ArchiveFilter; use Atoolo\Search\Dto\Search\Query\Filter\CategoryFilter; use Atoolo\Search\Dto\Search\Query\Filter\ContentSectionTypeFilter; use Atoolo\Search\Dto\Search\Query\Filter\Filter; @@ -22,13 +21,18 @@ use Atoolo\Search\Dto\Search\Query\Filter\ObjectTypeFilter; use Atoolo\Search\Dto\Search\Query\Filter\RelativeDateRangeFilter; use Atoolo\Search\Dto\Search\Query\Filter\SiteFilter; +use Atoolo\Search\Dto\Search\Query\Filter\SpatialArbitraryRectangleFilter; +use Atoolo\Search\Dto\Search\Query\Filter\SpatialOrbitalFilter; +use Atoolo\Search\Dto\Search\Query\GeoPoint; use Atoolo\Search\Dto\Search\Query\Sort\Criteria; use Atoolo\Search\Dto\Search\Query\Sort\CustomField; use Atoolo\Search\Dto\Search\Query\Sort\Date; +use Atoolo\Search\Dto\Search\Query\Sort\Direction; use Atoolo\Search\Dto\Search\Query\Sort\Headline; use Atoolo\Search\Dto\Search\Query\Sort\Name; use Atoolo\Search\Dto\Search\Query\Sort\Natural; use Atoolo\Search\Dto\Search\Query\Sort\Score; +use Atoolo\Search\Dto\Search\Query\Sort\SpatialDist; use Atoolo\Search\Service\Search\Schema2xFieldMapper; use Exception; use InvalidArgumentException; @@ -76,6 +80,8 @@ public static function getFilter(): array [ SiteFilter::class, 'sp_site' ], [ RelativeDateRangeFilter::class, 'sp_date_list' ], [ AbsoluteDateRangeFilter::class, 'sp_date_list' ], + [ SpatialOrbitalFilter::class, 'sp_geo_points' ], + [ SpatialArbitraryRectangleFilter::class, 'sp_geo_points' ], ]; } @@ -160,6 +166,15 @@ public function testGetSortField( ); } + public function testGetSortSpatialDistField(): void + { + $criteria = new SpatialDist(Direction::ASC, new GeoPoint(1, 2)); + $this->assertEquals( + 'geodist(sp_geo_points,2,1)', + $this->mapper->getSortField($criteria), + ); + } + public function testGetSortCustomField(): void { $criteria = new CustomField('custom_field'); diff --git a/test/Service/Search/SolrQueryFacetAppenderTest.php b/test/Service/Search/SolrQueryFacetAppenderTest.php index a830bec..4e2701a 100644 --- a/test/Service/Search/SolrQueryFacetAppenderTest.php +++ b/test/Service/Search/SolrQueryFacetAppenderTest.php @@ -10,6 +10,8 @@ use Atoolo\Search\Dto\Search\Query\Facet\ObjectTypeFacet; use Atoolo\Search\Dto\Search\Query\Facet\QueryFacet; use Atoolo\Search\Dto\Search\Query\Facet\RelativeDateRangeFacet; +use Atoolo\Search\Dto\Search\Query\Facet\SpatialDistanceRangeFacet; +use Atoolo\Search\Dto\Search\Query\GeoPoint; use Atoolo\Search\Service\Search\Schema2xFieldMapper; use Atoolo\Search\Service\Search\SolrQueryFacetAppender; use DateInterval; @@ -279,6 +281,26 @@ public function testAppendRelativeDateRangeFacetWithGap(): void ); } + public function testAppendGeoDistanceRangeFacet(): void + { + $this->facetQuery->expects($this->once()) + ->method('setQuery') + ->with('{!frange l=0 u=10}geodist(,10,10)'); + $this->facetQuery->expects($this->once()) + ->method('setExcludes') + ->with(['geofilter']); + + $this->appender->append( + new SpatialDistanceRangeFacet( + 'mykey', + new GeoPoint(10, 10), + 0, + 10, + ['geofilter'], + ), + ); + } + public function testUnsupportedFacet(): void { $this->expectException(InvalidArgumentException::class); diff --git a/test/Service/Search/SolrQueryFilterAppenderTest.php b/test/Service/Search/SolrQueryFilterAppenderTest.php index eb80f92..615268c 100644 --- a/test/Service/Search/SolrQueryFilterAppenderTest.php +++ b/test/Service/Search/SolrQueryFilterAppenderTest.php @@ -12,6 +12,10 @@ use Atoolo\Search\Dto\Search\Query\Filter\OrFilter; use Atoolo\Search\Dto\Search\Query\Filter\QueryFilter; use Atoolo\Search\Dto\Search\Query\Filter\RelativeDateRangeFilter; +use Atoolo\Search\Dto\Search\Query\Filter\SpatialArbitraryRectangleFilter; +use Atoolo\Search\Dto\Search\Query\Filter\SpatialOrbitalFilter; +use Atoolo\Search\Dto\Search\Query\Filter\SpatialOrbitalMode; +use Atoolo\Search\Dto\Search\Query\GeoPoint; use Atoolo\Search\Service\Search\Schema2xFieldMapper; use Atoolo\Search\Service\Search\SolrQueryFilterAppender; use DateInterval; @@ -166,6 +170,50 @@ public function testAbsoluteDateRangeFilterWithTo(): void $this->appender->append($filter); } + public function testSpatialOrbitalFilterWithGreateCircleDistanceMode(): void + { + $filter = new SpatialOrbitalFilter( + 4, + new GeoPoint(1, 2), + SpatialOrbitalMode::GREAT_CIRCLE_DISTANCE, + ); + + $this->filterQuery->expects($this->once()) + ->method('setQuery') + ->with('{!geofilt sfield=test pt=2,1 d=4}'); + + $this->appender->append($filter); + } + + public function testSpatialOrbitalFilterWithBoundingBoxMode(): void + { + $filter = new SpatialOrbitalFilter( + 4, + new GeoPoint(1, 2), + SpatialOrbitalMode::BOUNDING_BOX, + ); + + $this->filterQuery->expects($this->once()) + ->method('setQuery') + ->with('{!bbox sfield=test pt=2,1 d=4}'); + + $this->appender->append($filter); + } + + public function testSpatialArbitraryRectangleFilter(): void + { + $filter = new SpatialArbitraryRectangleFilter( + new GeoPoint(1, 2), + new GeoPoint(3, 4), + ); + + $this->filterQuery->expects($this->once()) + ->method('setQuery') + ->with('test:[ 2,1 TO 4,3 ]'); + + $this->appender->append($filter); + } + /** * @return array */ diff --git a/test/Service/Search/SolrResultToResourceResolverTest.php b/test/Service/Search/SolrResultToResourceResolverTest.php index a1cbd0a..9752eb3 100644 --- a/test/Service/Search/SolrResultToResourceResolverTest.php +++ b/test/Service/Search/SolrResultToResourceResolverTest.php @@ -146,4 +146,48 @@ public function testWithExplain(): void 'unexpected explain', ); } + + /** + * @throws Exception + */ + public function testWithGeoDinstance(): void + { + $document = $this->createStub(Document::class); + $document->method('getFields')->willReturn(['distance' => 22]); + $result = $this->createStub(SelectResult::class); + $result->method('getIterator')->willReturn( + new ArrayIterator([$document]), + ); + + $resourceFactory = $this->createStub(ResourceFactory::class); + $resourceFactory->method('accept')->willReturn(true); + $resource = new Resource( + 'location', + 'id', + 'name', + 'objectType', + ResourceLanguage::default(), + new DataBag([]), + ); + $resourceFactory->method('create')->willReturn($resource); + + $explainBuilder = $this->createMock(SolrExplainBuilder::class); + + $resolver = new SolrResultToResourceResolver([$resourceFactory], $explainBuilder); + + $resourceList = $resolver->loadResourceList( + $result, + ResourceLanguage::default(), + ); + + /** @var array{geo:array{distance:float}} $base */ + $base = $resourceList[0]->data->getArray('base'); + + $this->assertEquals( + 22.0, + $base['geo']['distance'], + 'unexpected explain', + ); + } + } diff --git a/test/Service/Search/SolrSearchTest.php b/test/Service/Search/SolrSearchTest.php index 625e24d..7407638 100644 --- a/test/Service/Search/SolrSearchTest.php +++ b/test/Service/Search/SolrSearchTest.php @@ -11,6 +11,7 @@ use Atoolo\Search\Dto\Search\Query\Facet\ObjectTypeFacet; use Atoolo\Search\Dto\Search\Query\Facet\QueryFacet; use Atoolo\Search\Dto\Search\Query\Filter\ObjectTypeFilter; +use Atoolo\Search\Dto\Search\Query\GeoPoint; use Atoolo\Search\Dto\Search\Query\QueryOperator; use Atoolo\Search\Dto\Search\Query\SearchQuery; use Atoolo\Search\Dto\Search\Query\Sort\Date; @@ -87,6 +88,7 @@ protected function setUp(): void $schemaFieldMapper = $this->createStub( Schema2xFieldMapper::class, ); + $schemaFieldMapper->method('getGeoPointField')->willReturn('geo_points'); $this->searcher = new SolrSearch( $indexName, @@ -111,6 +113,7 @@ public function testSelectEmpty(): void defaultQueryOperator: QueryOperator::OR, timeZone: null, boosting: null, + distanceReferencePoint: null, ); $searchResult = $this->searcher->search($query); @@ -136,6 +139,7 @@ public function testSelectWithText(): void defaultQueryOperator: QueryOperator::OR, timeZone: null, boosting: null, + distanceReferencePoint: null, ); $searchResult = $this->searcher->search($query); @@ -167,6 +171,7 @@ public function testSelectWithSort(): void defaultQueryOperator: QueryOperator::OR, timeZone: null, boosting: null, + distanceReferencePoint: null, ); $searchResult = $this->searcher->search($query); @@ -178,6 +183,30 @@ public function testSelectWithSort(): void ); } + public function testSelectWithDistanceField(): void + { + $query = new SearchQuery( + text: '', + lang: ResourceLanguage::default(), + offset: 0, + limit: 10, + sort: [], + filter: [], + facets: [], + archive: false, + defaultQueryOperator: QueryOperator::OR, + timeZone: null, + boosting: null, + distanceReferencePoint: new GeoPoint(3, 4), + ); + + $this->solrQuery->expects($this->once()) + ->method('addField') + ->with('distance:geodist(geo_points,4,3)'); + + $this->searcher->search($query); + } + public function testSelectWithAndDefaultOperator(): void { $query = new SearchQuery( @@ -192,6 +221,7 @@ public function testSelectWithAndDefaultOperator(): void defaultQueryOperator: QueryOperator::AND, timeZone: null, boosting: null, + distanceReferencePoint: null, ); $searchResult = $this->searcher->search($query); @@ -219,6 +249,7 @@ public function testSelectWithFilter(): void defaultQueryOperator: QueryOperator::OR, timeZone: null, boosting: null, + distanceReferencePoint: null, ); $searchResult = $this->searcher->search($query); @@ -255,6 +286,7 @@ public function testSelectWithFacets(): void defaultQueryOperator: QueryOperator::OR, timeZone: null, boosting: null, + distanceReferencePoint: null, ); $searchResult = $this->searcher->search($query); @@ -285,6 +317,7 @@ public function testSelectWithInvalidFacets(): void defaultQueryOperator: QueryOperator::OR, timeZone: null, boosting: null, + distanceReferencePoint: null, ); $this->expectException(InvalidArgumentException::class); @@ -321,6 +354,7 @@ public function testResulWithFacetField(): void defaultQueryOperator: QueryOperator::OR, timeZone: null, boosting: null, + distanceReferencePoint: null, ); $searchResult = $this->searcher->search($query); @@ -367,6 +401,7 @@ public function testResultWithFacetQuery(): void defaultQueryOperator: QueryOperator::OR, timeZone: null, boosting: null, + distanceReferencePoint: null, ); $searchResult = $this->searcher->search($query); @@ -419,6 +454,7 @@ public function testInvalidResultFacets(): void defaultQueryOperator: QueryOperator::OR, timeZone: null, boosting: null, + distanceReferencePoint: null, ); $this->expectException(InvalidArgumentException::class); @@ -450,6 +486,7 @@ public function testResultWithoutFacets(): void defaultQueryOperator: QueryOperator::OR, timeZone: null, boosting: null, + distanceReferencePoint: null, ); $searchResult = $this->searcher->search($query); @@ -474,6 +511,7 @@ public function testSetTimeZone(): void defaultQueryOperator: QueryOperator::OR, timeZone: new DateTimeZone("UTC"), boosting: null, + distanceReferencePoint: null, ); $this->solrQuery->expects($this->once()) @@ -497,6 +535,7 @@ public function testSetDefaultTimeZone(): void defaultQueryOperator: QueryOperator::OR, timeZone: null, boosting: null, + distanceReferencePoint: null, ); $this->solrQuery->expects($this->once()) @@ -520,6 +559,7 @@ public function testExplain(): void defaultQueryOperator: QueryOperator::OR, timeZone: null, boosting: null, + distanceReferencePoint: null, explain: true, );