Table implementation that wraps a saved QueryBean, exposing either its raw search results or one of its configured aggregations as rows. Built automatically for every saved query by QueryManager.getTables: one table for the query's selected fields (id ending "-Rows") and one table per configured aggregation (id ending with the aggregation name), each producing a row per matching hit or aggregation bucket.
Implements: Table
Properties
| Property | Returns | Description |
|---|---|---|
| description | String | Human readable description identifying the underlying query and, for an aggregation table, which aggregation it exposes. |
| headers | List<String> | Column headers: the query's selected field names for the raw results table, or "Key" and "Value" for an aggregation table. |
| tableId | String | The generated table id: the query's name with "-Rows" appended for the raw results table, or the query's name with the aggregation name appended for an aggregation table. |
Inherited from Table
Methods
getRows(int start, Integer maxRows)
Returns: RowsResult
Reads a page of rows starting at the given row, discarding any progress status. Delegates to the three argument overload with a status callback that does nothing.
| Parameter | Description |
|---|---|
start | the zero based index of the first row to return |
maxRows | the maximum number of rows to return, or null for no limit |
getRows(int start, Integer maxRows, Consumer<String> status, Map<String,Object> extraParams)
Returns: RowsResult
Reads a page of rows, optionally taking extra parameters that a specific table implementation can use to filter its results. The default implementation ignores extraParams and reads from row zero rather than the given start; implementations that use extraParams override this method directly.
| Parameter | Description |
|---|---|
start | the zero based index of the first row to return; not used by the default implementation |
maxRows | the maximum number of rows to return, or null for no limit |
status | callback invoked with progress messages while the rows are being read |
extraParams | implementation specific filter parameters; not used by the default implementation |
supportsPagination()
Returns: boolean
Whether this table supports paged reads via the start and maxRows parameters of getRows. A table that returns false always returns its full result set regardless of the paging parameters supplied.
Methods
getTableId()
Returns: String
The generated table id: the query's name with "-Rows" appended for the raw results table, or the query's name with the aggregation name appended for an aggregation table.
getDescription()
Returns: String
Human readable description identifying the underlying query and, for an aggregation table, which aggregation it exposes.
getHeaders()
Returns: List<String>
Column headers: the query's selected field names for the raw results table, or "Key" and "Value" for an aggregation table.
getRows(int start, Integer maxRows, Consumer<String> status)
Returns: RowsResult
Runs the wrapped query and converts the response into rows: search hits for the raw results table, or aggregation buckets (or a single key and value for a single valued aggregation) for an aggregation table. Logs a warning and returns an empty result if the query fails, the aggregation is missing, or the aggregation type is not one of the supported kinds.
| Parameter | Description |
|---|---|
start | the zero based index of the first row to return |
maxRows | the maximum number of rows to request; null or a value over 5000 is treated as 5000 |
status | progress callback; not used by this implementation |