FOSElasticaBundle icon indicating copy to clipboard operation
FOSElasticaBundle copied to clipboard

[Search] dispatch a "onSearch" and "onSearchResults" events

Open dkarlovi opened this issue 6 years ago • 0 comments

If you're using a library to construct your query (like rollerworks/search-elasticsearch), it will construct the query for you. This means you might not have access to the final query directly.

What would be helpful here is to allow the developer to access the query object after it has already been constructed, for example to add aggregations etc, by adding a new event Search, giving access to the Query instance.

The symmetrical feature would be to then allow the developer to also receive search results via SearchResult event, giving access to the ResultSet. This is where the developer could fetch the aggregations or do something else.

Note: I know this could be added to the linked library since it's perfectly able to dispatch those events, but IMO this would fit here perfectly and benefit all the users of this bundle, that's the reason I'm proposing this here first.

dkarlovi avatar May 29 '19 12:05 dkarlovi