Skip to content

Commit

Permalink
chore: rename to vchord-bm25 (#9)
Browse files Browse the repository at this point in the history
Signed-off-by: usamoi <[email protected]>
  • Loading branch information
usamoi authored Dec 9, 2024
1 parent 12903f6 commit 1583865
Show file tree
Hide file tree
Showing 14 changed files with 18 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
matrix:
arch: ["x86_64", "aarch64"]
env:
PGRX_IMAGE: "kemingy/pgrx:0.12.8"
PGRX_IMAGE: "ghcr.io/tensorchord/vectorchord-pgrx:0.12.8"

steps:
- uses: actions/checkout@v4
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[package]
name = "pg_bm25"
name = "vchord_bm25"
version = "0.0.0"
edition = "2021"

[lib]
crate-type = ["cdylib", "lib"]

[[bin]]
name = "pgrx_embed_pg_bm25"
name = "pgrx_embed_vchord_bm25"
path = "./src/bin/pgrx_embed.rs"

[features]
Expand Down
6 changes: 0 additions & 6 deletions pg_bm25.control

This file was deleted.

2 changes: 0 additions & 2 deletions rust-toolchain.toml

This file was deleted.

4 changes: 2 additions & 2 deletions src/datatype/memory_bm25vector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ pub enum Bm25VectorInput<'a> {
Borrowed(&'a Bm25VectorHeader),
}

impl<'a> Bm25VectorInput<'a> {
impl Bm25VectorInput<'_> {
unsafe fn new(p: NonNull<Bm25VectorHeader>) -> Self {
let q = unsafe {
NonNull::new(pgrx::pg_sys::pg_detoast_datum(p.cast().as_ptr()).cast()).unwrap()
Expand Down Expand Up @@ -129,7 +129,7 @@ impl Drop for Bm25VectorOutput {
}
}

impl<'a> FromDatum for Bm25VectorInput<'a> {
impl FromDatum for Bm25VectorInput<'_> {
unsafe fn from_polymorphic_datum(datum: Datum, is_null: bool, _typoid: Oid) -> Option<Self> {
if is_null {
None
Expand Down
2 changes: 1 addition & 1 deletion src/index/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ pub unsafe extern "C" fn ambuild(
index_tuples: 0,
index,
builder: IndexBuilder::new(),
memctx: PgMemoryContexts::new("pg_bm25_index_build"),
memctx: PgMemoryContexts::new("vchord_bm25_index_build"),
};

pgrx::pg_sys::IndexBuildHeapScan(heap, index, index_info, Some(build_callback), &mut state);
Expand Down
1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![feature(doc_cfg)]
#![allow(clippy::len_without_is_empty)]

pub mod algorithm;
Expand Down
2 changes: 1 addition & 1 deletion src/segment/field_norm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pub trait FieldNormRead {

pub struct FieldNormMemoryReader<'a>(&'a [u8]);

impl<'a> FieldNormRead for FieldNormMemoryReader<'a> {
impl FieldNormRead for FieldNormMemoryReader<'_> {
fn read(&self, doc_id: u32) -> u8 {
self.0[doc_id as usize]
}
Expand Down
2 changes: 1 addition & 1 deletion src/sql/finalize.sql
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ CREATE FUNCTION to_bm25query(index_oid regclass, query_str text) RETURNS bm25que
$$;

CREATE ACCESS METHOD bm25 TYPE INDEX HANDLER _bm25_amhandler;
COMMENT ON ACCESS METHOD bm25 IS 'pg_bm25 index access method';
COMMENT ON ACCESS METHOD bm25 IS 'vchord bm25 index access method';

CREATE OPERATOR pg_catalog.<&> (
PROCEDURE = search_bm25query,
Expand Down
2 changes: 1 addition & 1 deletion tests/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Tests for pg_bm25.rs
## Tests for vchord_bm25

We use [sqllogictest-rs](https://github.com/risinglightdb/sqllogictest-rs) to test the SQL queries.

Expand Down
2 changes: 1 addition & 1 deletion tests/init.sql
Original file line number Diff line number Diff line change
@@ -1 +1 @@
CREATE EXTENSION pg_bm25;
CREATE EXTENSION vchord_bm25;
2 changes: 1 addition & 1 deletion tests/sqllogictest/index.slt
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ LIMIT 10;

statement ok
INSERT INTO documents (passage) VALUES
('pg_bm25 is a postgresql extension for bm25 ranking algorithm.');
('vchord_bm25 is a postgresql extension for bm25 ranking algorithm.');

statement ok
UPDATE documents SET embedding = tokenize(passage) WHERE embedding IS NULL;
Expand Down
2 changes: 1 addition & 1 deletion tests/sqllogictest/temp.slt
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ LIMIT 10;

statement ok
INSERT INTO documents (passage) VALUES
('pg_bm25 is a postgresql extension for bm25 ranking algorithm.');
('vchord_bm25 is a postgresql extension for bm25 ranking algorithm.');

statement ok
UPDATE documents SET embedding = tokenize(passage) WHERE embedding IS NULL;
Expand Down
6 changes: 6 additions & 0 deletions vchord_bm25.control
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
comment = 'vchord_bm25: A postgresql extension for bm25 ranking algorithm'
default_version = '@CARGO_VERSION@'
module_pathname = '$libdir/vchord_bm25'
relocatable = false
superuser = true
schema = bm25_catalog

0 comments on commit 1583865

Please sign in to comment.