Skip to content

feat(search): geohash aggregation - #3272

Draft
dschmidt wants to merge 1 commit into
feat/search-bleve-geohash-siblingfrom
feat/search-geohash-aggregation
Draft

dschmidt wants to merge 1 commit into
feat/search-bleve-geohash-siblingfrom
feat/search-geohash-aggregation

Conversation

@dschmidt

@dschmidt dschmidt commented Aug 8, 2026 •

Copy link
Copy Markdown
Contributor

Description

@libre.graph.geohashDefinition {precision} (1 to 12) turns an aggregation on a geopoint field into a geohash grid: the bucket key is the cell, the count is the number of matches in it. size limits the answer to the top cells by count. A non-geopoint field and a precision outside 1 to 12 are rejected.

  • OpenSearch: native geohash_grid on the geopoint sibling.
  • bleve: folded from the doc values of the geohash sibling from feat(search): geohash support in bleve #3519, like the other aggregation levels.
  • graph: the endpoint answered the property with 501 so far, it now forwards it. location is accepted as an aggregation field.

Stacked on #3211 and #3519. No mapping change.

How Has This Been Tested

  • Parity suite on both engines: AGG-50 cells at precision 5, AGG-51 a terms aggregation nested in cells at precision 3.
  • aggregation/validate_test.go: non-geopoint field and precision 13 are rejected.
  • graph: the request reaches the search service with field and precision.

Types of changes

  • New feature (non-breaking change which adds functionality)

@codacy-production

codacy-production Bot commented Aug 8, 2026 •

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 16 complexity

Metric Results
Complexity 16

View in Codacy

🟢 Coverage 16.95% diff coverage · 0.00% coverage variation

Metric Results
Coverage variation ✅ 0.00% coverage variation (-1.00%)
Diff coverage ✅ 16.95% diff coverage

View coverage diff in Codacy

Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (4d6542d) 97144 30746 31.65%
Head commit (fd4e805) 97209 (+65) 30765 (+19) 31.65% (0.00%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#3272) 118 20 16.95%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@dschmidt
dschmidt force-pushed the feat/graph-search-query branch from 1b61ef6 to fb1e41b Compare August 18, 2026 16:51
@dschmidt
dschmidt force-pushed the feat/search-geohash-aggregation branch from 59aacc8 to c775513 Compare August 18, 2026 17:00
@dschmidt
dschmidt force-pushed the feat/graph-search-query branch 9 times, most recently from 2513263 to 71ca404 Compare September 3, 2026 08:33
@dschmidt
dschmidt force-pushed the feat/search-geohash-aggregation branch from c775513 to 2d46411 Compare September 7, 2026 22:14
dschmidt added a commit that referenced this pull request Sep 8, 2026
The same tokenizer with tag_depth turns a geohash into depth-tagged prefixes, so a terms facet with TermPrefix is a geohash grid at that precision. One location_geohash field per geopoint, part of the v5 schema so #3272 needs no further bump. OpenSearch maps it unindexed, geohash_grid works on the geo_point.
dschmidt added a commit that referenced this pull request Sep 10, 2026
Path was a keyword, so the descendant lookup behind delete/move/restore/purge, the scoped search and the KQL path predicate expanded into one term searcher per descendant and OOM-killed the server on large folders (#1269, #3469).

Path is now analyzed into its ancestor prefixes, like path_hierarchy in OpenSearch: ./a/b.txt becomes ., ./a, ./a/b.txt. A folder's descendants are every document carrying the folder's path as a term, so all three call sites are a single term query. Schema 4 -> 5, v4 never shipped.

The same tokenizer with tag_depth is registered as the geohash analyzer, so #3272 can add its geohash field without another schema change.
dschmidt added a commit that referenced this pull request Sep 10, 2026
Path was a keyword, so the descendant lookup behind delete/move/restore/purge, the scoped search and the KQL path predicate expanded into one term searcher per descendant and OOM-killed the server on large folders (#1269, #3469).

Path is now analyzed into its ancestor prefixes, like path_hierarchy in OpenSearch: ./a/b.txt becomes ., ./a, ./a/b.txt. A folder's descendants are every document carrying the folder's path as a term, so all three call sites are a single term query. Schema 4 -> 5, v4 never shipped.

The same tokenizer with tag_depth is registered as the geohash analyzer, so #3272 can add its geohash field without another schema change.
dschmidt added a commit that referenced this pull request Sep 10, 2026
Path was a keyword, so the descendant lookup behind delete/move/restore/purge, the scoped search and the KQL path predicate expanded into one term searcher per descendant and OOM-killed the server on large folders (#1269, #3469).

Path is now analyzed into its ancestor prefixes, like path_hierarchy in OpenSearch: ./a/b.txt becomes ., ./a, ./a/b.txt. A folder's descendants are every document carrying the folder's path as a term, so all three call sites are a single term query. Schema 4 -> 5, v4 never shipped.

The same tokenizer with tag_depth is registered as the geohash analyzer, so #3272 can add its geohash field without another schema change.
dschmidt added a commit that referenced this pull request Sep 10, 2026
Path was a keyword, so the descendant lookup behind delete/move/restore/purge, the scoped search and the KQL path predicate expanded into one term searcher per descendant and OOM-killed the server on large folders (#1269, #3469).

Path is now analyzed into its ancestor prefixes, like path_hierarchy in OpenSearch: ./a/b.txt becomes ., ./a, ./a/b.txt. A folder's descendants are every document carrying the folder's path as a term, so all three call sites are a single term query. Schema 4 -> 5, v4 never shipped.

The same tokenizer with tag_depth is registered as the geohash analyzer, so #3272 can add its geohash field without another schema change.
dschmidt added a commit that referenced this pull request Sep 10, 2026
Path was a keyword, so the descendant lookup behind delete/move/restore/purge, the scoped search and the KQL path predicate expanded into one term searcher per descendant and OOM-killed the server on large folders (#1269, #3469).

Path is now analyzed into its ancestor prefixes, like path_hierarchy in OpenSearch: ./a/b.txt becomes ., ./a, ./a/b.txt. A folder's descendants are every document carrying the folder's path as a term, so all three call sites are a single term query. Schema 4 -> 5, v4 never shipped.

The same tokenizer with tag_depth is registered as the geohash analyzer, so #3272 can add its geohash field without another schema change.
dschmidt added a commit that referenced this pull request Sep 11, 2026
OpenSearch buckets a geohash_grid aggregation on the geo_point itself, bleve has no such aggregation. bleve now maps a <name>_geohash field next to every geopoint field and writes the geohash from the batch, analyzed into depth-tagged prefixes, so a terms facet with TermPrefix "<precision>/" is the grid at that precision (#3272). Only bleve knows the field, the shared document shape and OpenSearch are untouched; the mapping change is additive.
dschmidt added a commit that referenced this pull request Sep 11, 2026
bleve maps a <name>_geohash field next to every geopoint field and writes the geohash from the batch, analyzed into depth-tagged prefixes, so a terms facet with TermPrefix "<precision>/" is a geohash grid (#3272). bleve only, additive on the v5 schema.
dschmidt added a commit that referenced this pull request Sep 11, 2026
bleve maps a <name>_geohash field next to every geopoint field and writes the geohash from the batch, analyzed into depth-tagged prefixes, so a terms facet with TermPrefix "<precision>/" is a geohash grid (#3272). bleve only, additive on the v5 schema.
dschmidt added a commit that referenced this pull request Sep 11, 2026
bleve maps a <name>_geohash field next to every geopoint field and writes the geohash from the batch, analyzed into one depth-tagged term per precision. Groundwork for a geohash grid on bleve (#3272), nothing queries it yet. bleve only, additive on the v5 schema.
dschmidt added a commit that referenced this pull request Sep 11, 2026
bleve maps a <name>_geohash field next to every geopoint field and writes the geohash from the batch, analyzed into one depth-tagged term per precision. Groundwork for a geohash grid on bleve (#3272), nothing queries it yet. bleve only, additive on the v5 schema.
dschmidt added a commit that referenced this pull request Sep 11, 2026
bleve maps a <name>_geohash field next to every geopoint field and writes the geohash from the batch, analyzed into one depth-tagged term per precision. Groundwork for a geohash grid on bleve (#3272), nothing queries it yet. bleve only, additive on the v5 schema.
dschmidt added a commit that referenced this pull request Sep 11, 2026
bleve maps a <name>_geohash field next to every geopoint field and writes the geohash from the batch, analyzed into one depth-tagged term per precision. Groundwork for a geohash grid on bleve (#3272), nothing queries it yet. bleve only, additive on the v5 schema.
dschmidt added a commit that referenced this pull request Sep 11, 2026
bleve maps a <name>_geohash field next to every geopoint field and writes the geohash from the batch, analyzed into one depth-tagged term per precision. Groundwork for a geohash grid on bleve (#3272), nothing queries it yet. bleve only, additive on the v5 schema.
dschmidt added a commit that referenced this pull request Sep 11, 2026
bleve maps a <name>_geohash field next to every geopoint field and writes the geohash from the batch, analyzed into one depth-tagged term per precision. Groundwork for a geohash grid on bleve (#3272), nothing queries it yet. bleve only, additive on the v5 schema.
@dschmidt dschmidt mentioned this pull request Sep 11, 2026
1 task done
@dschmidt
dschmidt force-pushed the feat/graph-search-query branch from fef1116 to 7f7ecbf Compare September 11, 2026 14:30
dschmidt added a commit that referenced this pull request Sep 11, 2026
bleve maps a <name>_geohash field next to every geopoint field and writes the geohash from the batch, analyzed into one depth-tagged term per precision. Groundwork for a geohash grid on bleve (#3272), nothing queries it yet. bleve only, additive on the v5 schema.
@dschmidt
dschmidt force-pushed the feat/search-geohash-aggregation branch from 2d46411 to d7bdce8 Compare September 11, 2026 14:33
@dschmidt dschmidt changed the title feat(search): geohash aggregation (bleve + opensearch) feat(search): geohash aggregation Sep 11, 2026
@dschmidt
dschmidt changed the base branch from feat/graph-search-query to feat/search-bleve-geohash-sibling September 11, 2026 14:33
@dschmidt
dschmidt added this pull request to stack #3520 September 11, 2026 14:34
dschmidt added a commit that referenced this pull request Sep 12, 2026
bleve maps a <name>_geohash field next to every geopoint field and writes the geohash from the batch, analyzed into one depth-tagged term per precision. Groundwork for a geohash grid on bleve (#3272), nothing queries it yet. bleve only, additive on the v5 schema.
@dschmidt
dschmidt force-pushed the feat/search-bleve-geohash-sibling branch from f017713 to 9b4883b Compare September 12, 2026 15:34
@dschmidt
dschmidt force-pushed the feat/search-geohash-aggregation branch from d7bdce8 to c65b323 Compare September 12, 2026 15:34
dschmidt added a commit that referenced this pull request Sep 12, 2026
bleve maps a <name>_geohash field next to every geopoint field and writes the geohash from the batch, analyzed into one depth-tagged term per precision. Groundwork for a geohash grid on bleve (#3272), nothing queries it yet. bleve only, additive on the v5 schema.
@dschmidt
dschmidt force-pushed the feat/search-bleve-geohash-sibling branch from 9b4883b to 3d449df Compare September 12, 2026 15:38
@dschmidt
dschmidt force-pushed the feat/search-geohash-aggregation branch from c65b323 to ffbdf81 Compare September 12, 2026 15:38
dschmidt added a commit that referenced this pull request Sep 12, 2026
bleve maps a <name>_geohash field next to every geopoint field and writes the geohash from the batch, analyzed into one depth-tagged term per precision. Groundwork for a geohash grid on bleve (#3272), nothing queries it yet. bleve only, additive on the v5 schema.
@dschmidt
dschmidt force-pushed the feat/search-bleve-geohash-sibling branch from 3d449df to f0f9fce Compare September 12, 2026 16:23
@dschmidt
dschmidt force-pushed the feat/search-geohash-aggregation branch from ffbdf81 to db0b7b1 Compare September 12, 2026 16:23
dschmidt added a commit that referenced this pull request Sep 12, 2026
bleve maps a <name>_geohash field next to every geopoint field and writes the geohash from the batch, analyzed into one depth-tagged term per precision. Groundwork for a geohash grid on bleve (#3272), nothing queries it yet. bleve only, additive on the v5 schema.
@dschmidt
dschmidt force-pushed the feat/search-bleve-geohash-sibling branch from f0f9fce to 96dd924 Compare September 12, 2026 16:34
@dschmidt
dschmidt force-pushed the feat/search-geohash-aggregation branch from db0b7b1 to fbc1806 Compare September 12, 2026 16:34
@dschmidt
dschmidt removed this pull request from stack #3520 October 5, 2026 06:48
dschmidt added a commit that referenced this pull request Oct 6, 2026
bleve maps a <name>_geohash field next to every geopoint field and writes the geohash from the batch, analyzed into one depth-tagged term per precision. Groundwork for a geohash grid on bleve (#3272), nothing queries it yet. bleve only, additive on the v5 schema.
@dschmidt
dschmidt force-pushed the feat/search-bleve-geohash-sibling branch from 96dd924 to 58c52b7 Compare October 6, 2026 09:24
dschmidt added a commit that referenced this pull request Nov 25, 2026
bleve maps a <name>_geohash field next to every geopoint field and writes the geohash on every write of a document (batch and metadata update), analyzed into one depth-tagged term per precision. Groundwork for a geohash grid on bleve (#3272), nothing queries it yet. bleve only, additive on the v5 schema.
@dschmidt
dschmidt force-pushed the feat/search-bleve-geohash-sibling branch from 58c52b7 to 4d6542d Compare November 25, 2026 13:00
A geohash_grid aggregation over a geopoint field, requested with
@libre.graph.geohashDefinition {precision}. OpenSearch answers it with
geohash_grid on the geopoint field, bleve folds the doc values of the
geohash sibling field. size limits the buckets to the top cells by count.
@dschmidt
dschmidt force-pushed the feat/search-geohash-aggregation branch from fbc1806 to fd4e805 Compare November 25, 2026 22:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant