Hello, thank you for your work on all of these packages!
Wondering if there is more recommended way to work with Aggs than my current approach below. I’m using the example repo app-search-reference-ui to try out these packages.
Aggs in API Requests
I see that a top level aggs:{} prop is included in the request payload. But from looking at how the request is built in Request.ts, it seems aggs is not one of the props plucked from queryConfig or requestState.
Aggs in UI State
In the API docs I see there are functions exposed for updating filters, searchTerm, sort, etc but I’m not seeing any docs about maintaining and updating state for Aggs.
Current Workaround
I’m keeping the queryConfig in my app state. Using a postProcessFn (passed as 2nd arg to my ES connector instance), I read from that queryConfig and modify the request body to include aggs.
Could you share what type of aggregations you are hoping to add into the requestBody / maintain and share a typical Elasticsearch request with the aggregations you want? Could you also share what use-case you're hoping to achieve with controlling aggregations?
Behind the scenes, the elasticsearch-connector will use the facet configuration to generate the aggregations needed to power those facets. See here for more information Configuration | Elastic Documentation
hey @esTest, from what you said, my understanding is that you want to display a value which uses sums / avg field values in the result set? Its an interesting use-case but not something search-ui supports unfortunately.
The only thing I can suggest would be to query Elasticsearch separately for these field aggregation values and display them separately, leaving search-ui to handle the rest.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.