Support extra output field in TOP function#135434
Support extra output field in TOP function#135434przemekwitek merged 26 commits intoelastic:mainfrom
Conversation
ebada8e to
d7003ba
Compare
ℹ️ Important: Docs version tagging👋 Thanks for updating the docs! Just a friendly reminder that our docs are now cumulative. This means all 9.x versions are documented on the same page and published off of the main branch, instead of creating separate pages for each minor version. We use applies_to tags to mark version-specific features and changes. Expand for a quick overviewWhen to use applies_to tags:✅ At the page level to indicate which products/deployments the content applies to (mandatory) What NOT to do:❌ Don't remove or replace information that applies to an older version 🤔 Need help?
|
8995f31 to
f76d6e7
Compare
8cc245c to
0e61859
Compare
0e61859 to
5b005df
Compare
5b476e4 to
5b005df
Compare
225893a to
a5e475e
Compare
ae44028 to
7c1418b
Compare
cbc8827 to
6c1ccd2
Compare
- Fix grow() method in X-BucketedSort - Add `date` type to supported types of `outputField`
Put inline applies_to in the outputField param section.
a8cf9d4 to
37ad6b7
Compare
…-json * upstream/main: (158 commits) Cleanup files from repo root folder (elastic#138030) Implement OpenShift AI integration for chat completion, embeddings, and reranking (elastic#136624) Optimize AsyncSearchErrorTraceIT to avoid failures (elastic#137716) Removes support for null TransportService in RemoteClusterService (elastic#137939) Mute org.elasticsearch.index.mapper.DateFieldMapperTests testSortShortcuts elastic#138018 rest-api-spec: fix type of enums (elastic#137521) Update Gradle wrapper to 9.2.0 (elastic#136155) Add RCS Strong Verification Documentation (elastic#137822) Use docvalue skippers on dimension fields (elastic#137029) Introduce INDEX_SHARD_COUNT_FORMAT (elastic#137210) Mute org.elasticsearch.xpack.inference.integration.AuthorizationTaskExecutorIT testCreatesChatCompletion_AndThenCreatesTextEmbedding elastic#138012 Fix ES|QL search context creation to use correct results type (elastic#137994) Improve Snapshot Logging (elastic#137470) Support extra output field in TOP function (elastic#135434) Remove NumericDoubleValues class (elastic#137884) [ML] Fix ML calendar event update scalability issues (elastic#136886) Task may be unregistered outside of the trace context in exceptional cases. (elastic#137865) Refine workaround for S3 repo analysis known issue (elastic#138000) Additional DEBUG logging on authc failures (elastic#137941) Cleanup index resolution (elastic#137867) ...
|
The discussion on "Are we excluding keyword/bytesrefs-related types temporarily to be added later...?" was answered (I thought) with an effective Yes, excluded just temporarily, and the other combinations would be added later. "But eventually, we should support more combinations (potentially 7x7=49 rather than current 4x4=16)." Is this still the plan? Particularly where OutputField is keyword. "give me list of employee names, sorted by their salaries" ! |
There are cases where we would like to answer queries like:
"give me list of employees sorted by their salaries"
"give me list of countries sorted by their area"
etc.
Currently, the
TOPaggregation function only supports one field which is used as both sort field and the output field.This PR enhances the
TOPfunction by adding an optional parametermapToFieldwhich is the field we want as the output. The sorting will still be performed on thefield, just like today.Example:
"give me salaries of 3 youngest employees by gender"
Fixes #128630