Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Support text arrays #570

Merged
merged 5 commits into from
Nov 27, 2023
Merged

feat: Support text arrays #570

merged 5 commits into from
Nov 27, 2023

Conversation

rebasedming
Copy link
Collaborator

@rebasedming rebasedming commented Nov 26, 2023

Ticket(s) Closed

What

With this PR, Postgres text[] and varchar[] columns are properly recognized and indexed as Tantivy multivalue fields.

Usage:

CREATE TABLE example_table (
    id SERIAL PRIMARY KEY,
    text_array TEXT[]
);

INSERT INTO example_table (text_array) VALUES 
('{"text1", "text2", "text3"}'),
('{"another", "array", "of", "texts"}'),
('{"single element"}');

CREATE INDEX ON example_table
USING bm25 ((example_table.*))
WITH (text_fields='{text_array: {}}');

SELECT * FROM example_table WHERE example_table @@@ 'text_array:text1';
 id |     text_array
----+---------------------
  1 | {text1,text2,text3}
(1 row)

Why

How

Tests

Added an additional regression test

Copy link

vercel bot commented Nov 26, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
paradedb ⬜️ Ignored (Inspect) Visit Preview Nov 26, 2023 8:21pm

@rebasedming rebasedming mentioned this pull request Nov 26, 2023
Copy link

codecov bot commented Nov 26, 2023

Codecov Report

Merging #570 (d7c9254) into dev (83fd5d5) will increase coverage by 6.21%.
The diff coverage is 42.59%.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #570      +/-   ##
==========================================
+ Coverage   60.14%   66.36%   +6.21%     
==========================================
  Files          42       27      -15     
  Lines        3475     2720     -755     
==========================================
- Hits         2090     1805     -285     
+ Misses       1385      915     -470     
Files Coverage Δ
pg_bm25/src/parade_index/index.rs 71.61% <80.00%> (+0.03%) ⬆️
pg_bm25/src/json/builder.rs 24.03% <0.00%> (-2.28%) ⬇️
pg_bm25/src/index_access/utils.rs 61.82% <47.50%> (-5.46%) ⬇️

... and 15 files with indirect coverage changes

Copy link
Collaborator

@philippemnoel philippemnoel left a comment

Choose a reason for hiding this comment

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

pushed a fix for Codecov

@rebasedming rebasedming merged commit 1c5b4be into dev Nov 27, 2023
14 checks passed
@rebasedming rebasedming deleted the rebasedming/text-arrays branch November 27, 2023 17:23
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.

Support text arrays
3 participants