[TASK] Querybuilder refactoring#91
Conversation
To further extend the result with aggregation and suggestion meta data, the QueryBuilder is refactored to not only return the nodes but an array containing different elasticsearch result parts
There was a problem hiding this comment.
any reason why we convert the result to a different format and not just say $this->result = $hits?
There was a problem hiding this comment.
It should rather be $this->result = $treatedContent as we want to return the complete result including the e.g. aggregates. But that would fine.
|
Hey Daniel, See my nitpick :-) It would be great to have a small clarification whether the "array-based API" should be public or not; I suppose it should NOT be public. Correct? All the best, |
|
The direction looks good. As we discussed yesterday I'd still like to make it easier to achieve two things. Getting the meta result, which is currently not possible as I see it. You can only get certain things like aggregations. Having methods for specific meta results could be okay, however there should be a way to get the whole raw result and then it might not make sense having convenience methods like getAggregations but just use getResult()['aggregations'](the treatedContent from the ES result). |
|
Addendum on last comment, discussed with Daniel and since ES only seems to have two special return keys |
[TASK] Querybuilder refactoring
Refactor the queryBuilder and the result object as a basis for further extensions and improvements.
ElasticSearchQueryBuilder::fetch() now returns an array including the nodes and the other meta data results. The ElasticSearchQueryResult still provides the nodes through its ArrayAccess implementation but also returns additional data like aggregations and suggestions through specific getters.
Also added a first functional test. All tests are failing right now due to existing bugs.
Jira: IN-4