FOSElasticaBundle icon indicating copy to clipboard operation
FOSElasticaBundle copied to clipboard

Can't access Aggregation data via Finder; Pagerfanta deprecated `->getAdapter()`; Doc needs Update

Open floriankapaun opened this issue 3 years ago • 0 comments

The Usage Documentation, shows the following example to get Aggregation data:

...
$aggs = $companies->getAdapter()->getAggregations();

This is outdated, since Pagerfanta deprecated ->getAdapter() and there is no ->getAggregations() function within the AdapterInterface anymore.

I found no way to access aggregation data via the Finder as of now. Please correct me if I'm wrong.

We could easily provide this by making the TransformedFinders $searchable property accessible with a getter.

Then we could do something like

...
$companies = $this->finder->getSearchable()->search($query);

Some more Context: https://github.com/BabDev/Pagerfanta/issues/35

floriankapaun avatar Feb 04 '22 16:02 floriankapaun