-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
EZP-27458: Provided Aggregation API #94
Conversation
4214b61
to
9ea9886
Compare
f7ea204
to
23d440c
Compare
eZ/Publish/API/Repository/Values/Content/Query/Aggregation/Range.php
Outdated
Show resolved
Hide resolved
eZ/Publish/API/Repository/Values/Content/Query/Aggregation/Range.php
Outdated
Show resolved
Hide resolved
eZ/Publish/API/Repository/Values/Content/Search/AggregationResult/RangeAggregationResult.php
Show resolved
Hide resolved
...lish/API/Repository/Values/Content/Query/Aggregation/Field/AbstractFieldRangeAggregation.php
Outdated
Show resolved
Hide resolved
...lish/API/Repository/Values/Content/Query/Aggregation/Field/AbstractFieldStatsAggregation.php
Outdated
Show resolved
Hide resolved
* @group search | ||
* @group aggregations | ||
*/ | ||
final class SearchServiceAggregationTest extends BaseTest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the class is quite long, can be split into smaller ones? ex. by TermAggregation, test case etc.
Smaller classes will be more friendly to maintain in future
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. I will split this class into smaller once (by Aggregation) in follow up PR.
eZ/Publish/API/Repository/Tests/SearchServiceAggregationTest.php
Outdated
Show resolved
Hide resolved
eZ/Publish/API/Repository/Tests/SearchServiceAggregationTest.php
Outdated
Show resolved
Hide resolved
eZ/Publish/API/Repository/Tests/SearchServiceAggregationTest.php
Outdated
Show resolved
Hide resolved
eZ/Publish/API/Repository/Values/Content/Query/Aggregation/FieldAggregationInterface.php
Outdated
Show resolved
Hide resolved
eZ/Publish/API/Repository/Values/Content/Query/Aggregation/LocationAggregationInterface.php
Outdated
Show resolved
Hide resolved
eZ/Publish/API/Repository/Values/Content/Search/AggregationResult/RangeAggregationResult.php
Show resolved
Hide resolved
...ublish/API/Repository/Values/Content/Search/AggregationResult/TermAggregationResultEntry.php
Show resolved
Hide resolved
eZ/Publish/API/Repository/Values/Content/Search/AggregationResultCollection.php
Outdated
Show resolved
Hide resolved
Merging. Any further comments and suggestions will be taken into account as follow up PRs. |
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
v3.2
Introduction
Aggregation API is successor of Facet API, however aggregation is wider concept then facet.
Description
Aggregation MUST implement
\eZ\Publish\API\Repository\Values\Content\Query\AggregationInterface
interfaceMethod
getName()
SHOULD return identifier specified by API user and unique across query e.g.price_stats
,availability
,content_type_facet
.One or more aggregations could be added using
\eZ\Publish\API\Repository\Values\Content\Query::$aggregations
property in exact same way as in case of sort clauses:Aggregation Result MUST extends
\eZ\Publish\API\Repository\Values\Content\Search\AggregationResult
classCollection of aggregation results is accessible via
\eZ\Publish\API\Repository\Values\Content\Search\SearchResult::$aggregations
property.\eZ\Publish\API\Repository\Values\Content\Search\SearchResult::$aggregations
property is\eZ\Publish\API\Repository\Values\Content\Search\AggregationResultCollection
which offers the following APIAggregations which are not supported by search engine MUST be ignored.
Aggregation results are limited to objects which match criteria specified in
\eZ\Publish\API\Repository\Values\Content\Query::$filter
and\eZ\Publish\API\Repository\Values\Content\Query::$query
.Supported aggregations
Aggregations could be classified by type of result:
or by aggregation subject:
with subset of Field Type specific aggregations.
Content aggregations
ContentTypeTermAggregation
ContentTypeGroupTermAggregation
DateMetadataRangeAggregation
LanguageTermAggregation
ObjectStateTermAggregation
SectionTermAggregation
UserMetadataTermAggregation
VisibilityTermAggregation
Location aggregations
Location specific aggregations should implement
\eZ\Publish\API\Repository\Values\Content\Query\Aggregation\LocationAggregationInterface
marker interface.Field type specific aggregations
Field type specific aggregations should implement
\eZ\Publish\API\Repository\Values\Content\Query\Aggregation\FieldAggregationInterface
interfaceThe following aggregations are field type specific
CheckboxTermAggregation
CountryTermAggregation
DateRangeAggregation
DateTimeRangeAggregation
FloatRangeAggregation
FloatStatsAggregation
IntegerRangeAggregation
IntegerStatsAggregation
KeywordTermAggregation
SelectionTermAggregation
TimeRangeAggregation
Usage example:
Raw aggregations
Raw aggregations allows to compute aggregation for specified search index field name.
\eZ\Publish\API\Repository\Values\Content\Query\Aggregation\RawRangeAggregation
\eZ\Publish\API\Repository\Values\Content\Query\Aggregation\RawStatsAggregation
\eZ\Publish\API\Repository\Values\Content\Query\Aggregation\RawTermAggregation
TODO
\eZ\Publish\Core\Search\Common\FieldNameResolver::getAggregationFieldName
AggregationCollection
andAggregationResultCollection
(similar to\eZ\Publish\API\Repository\Values\ContentType\FieldDefinitionCollection
)\eZ\Publish\Core\FieldType\Float\Type::isSearchable
(EZP-31817: Enabled ezfloat values indexing #103)Checklist:
$ composer fix-cs
).