Skip to content

Geo distance grouping supports multivalue argument in indexed search#36222

Merged
johansolbakken merged 4 commits into
masterfrom
johsol/grouping-geo-distance-multi
Mar 18, 2026
Merged

Geo distance grouping supports multivalue argument in indexed search#36222
johansolbakken merged 4 commits into
masterfrom
johsol/grouping-geo-distance-multi

Conversation

@johansolbakken

@johansolbakken johansolbakken commented Mar 16, 2026

Copy link
Copy Markdown
Contributor

Adds support for geo_distance in grouping on a field that is array of positions.

@arnej27959 please review

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends GeoDistanceFunctionNode so geo distance grouping can work with multivalue (array) position attributes in indexed search by computing the minimum distance across all positions.

Changes:

  • Document multivalue (array<position>) behavior for geo distance (min distance returned).
  • Update GeoDistanceFunctionNode::onExecute() to support both single-value and ResultNodeVector inputs.
  • Add/adjust aggregator expression tests to cover multivalue geo distance behavior.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
searchlib/src/vespa/searchlib/expression/geo_distance_function_node.h Documents the new multivalue semantics (min distance).
searchlib/src/vespa/searchlib/expression/geo_distance_function_node.cpp Implements min-distance reduction when the attribute argument is a ResultNodeVector.
searchlib/src/tests/aggregator/perdocexpr_test.cpp Refactors geo test fixtures and adds a new multivalue geo distance unit test.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread searchlib/src/tests/aggregator/perdocexpr_test.cpp
johansolbakken and others added 2 commits March 17, 2026 09:32
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

@arnej27959 arnej27959 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good!

@johansolbakken johansolbakken merged commit bb6e708 into master Mar 18, 2026
3 checks passed
@johansolbakken johansolbakken deleted the johsol/grouping-geo-distance-multi branch March 18, 2026 10:02
@johansolbakken

Copy link
Copy Markdown
Contributor Author

Continuation of #36174

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants