FriendsOfSymfony/FOSElasticaBundle — pull request #414 by damienalexandre (2013-12-01 00:56:21+00:00)
Title: Allow TransformedFinder to be used by the outside world

This is a small API enhancement. When using Finder actually, there is no way to deal with Facet or other cool Elastica stuffs.

If I want to play this query:

```php
$query = \Elastica\Query::create("afsy");
$date_facet = new DateHistogram('years');
$date_facet->setField('published_at');
$date_facet->setInterval('year');
$query->addFacet($date_facet);
```

And retreive both a list of Entities AND my Facets, I can't find a way.

Here is what we can do with this PR:

```php
$articles = $this->get('fos_elastica.index.afsy.article')->search($query);

$facets = $articles->getFacets();
$years = $facets['years']['entries'];

$entities = $this->get('fos_elastica.finder.afsy.article')->transform($articles);

var_dump($years, $entities);
````

We fetch the results from the type, get the facets or anything else from the `ResultSet`, and then send the results to `TransformedFinder` for translation into entities.

What do you thing about it?