Skip to content

feat: Allow Top N + aggregates over literal normalized fields#4007

Merged
rebasedming merged 2 commits intomainfrom
feat/literal-normalized-fast-2
Jan 28, 2026
Merged

feat: Allow Top N + aggregates over literal normalized fields#4007
rebasedming merged 2 commits intomainfrom
feat/literal-normalized-fast-2

Conversation

@rebasedming
Copy link
Copy Markdown
Collaborator

Ticket(s) Closed

  • Closes #

What

It turns out fast fields store the untokenized representations of text (we had a misconception that the tokenized representations were being stored). As a result, any fast field can participate in Top N/aggregate pushdown since the ordering/grouping semantics of fast fields are unchanged vs. the raw Postgres values.

Why

How

Tests

@rebasedming rebasedming added cherry-pick/0.23.x Request that this PR to `main` should get an automatic cherry-pick PR to `0.23.x` after it lands. cherry-pick/0.22.x Request that this PR to `main` should get an automatic cherry-pick PR to `0.22.x` after it lands. labels Jan 27, 2026
Copy link
Copy Markdown
Collaborator

@stuhood stuhood left a comment

Choose a reason for hiding this comment

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

As discussed: this is a step towards:

  1. making all tokenizers optionally fast,
  2. potentially renaming literal_normalized, because it is not really "literal" so much as it is "single token with configurable token filters"

...But we won't cherry-pick those changes, so #shipit.

Comment thread pg_search/src/schema/mod.rs
@rebasedming rebasedming merged commit c0c03ea into main Jan 28, 2026
20 checks passed
@rebasedming rebasedming deleted the feat/literal-normalized-fast-2 branch January 28, 2026 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cherry-pick/0.22.x Request that this PR to `main` should get an automatic cherry-pick PR to `0.22.x` after it lands. cherry-pick/0.23.x Request that this PR to `main` should get an automatic cherry-pick PR to `0.23.x` after it lands.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants