From 72e65924659b0666ac4cfb35016e1bdfb0dd8035 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Miguel?= <36349314+vrmiguel@users.noreply.github.com> Date: Wed, 18 Oct 2023 16:23:13 -0300 Subject: [PATCH] contrib: add `pg_bm25` (#498) --- contrib/pg_bm25/Dockerfile | 29 +++++++++++++++++++++++++++++ contrib/pg_bm25/Trunk.toml | 22 ++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 contrib/pg_bm25/Dockerfile create mode 100644 contrib/pg_bm25/Trunk.toml diff --git a/contrib/pg_bm25/Dockerfile b/contrib/pg_bm25/Dockerfile new file mode 100644 index 00000000..35e22168 --- /dev/null +++ b/contrib/pg_bm25/Dockerfile @@ -0,0 +1,29 @@ +ARG PG_VERSION=15 +FROM quay.io/coredb/pgrx-builder:pg${PG_VERSION}-pgrx0.9.7 +USER root + +ARG RELEASE=v0.2.21 + +# Extension build dependencies +RUN apt-get update && apt-get install -y \ + build-essential + +# Install Rust +RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y + +# Set default Rust version +RUN /root/.cargo/bin/rustup default stable && /root/.cargo/bin/rustup override set 1.72.0 + +# Clone repository +RUN git clone /~https://github.com/paradedb/paradedb.git && \ + cd paradedb && \ + git fetch --tags && \ + git fetch --depth 1 origin tag ${RELEASE} && \ + git checkout ${RELEASE} + + +# Build the extension +RUN cd paradedb && \ + cd pg_bm25 && \ + cargo pgrx init --pg15 /usr/bin/pg_config && \ + cargo pgrx package diff --git a/contrib/pg_bm25/Trunk.toml b/contrib/pg_bm25/Trunk.toml new file mode 100644 index 00000000..cec5d511 --- /dev/null +++ b/contrib/pg_bm25/Trunk.toml @@ -0,0 +1,22 @@ +[extension] +name = "pg_bm25" +version = "0.4.0" +repository = "/~https://github.com/paradedb/paradedb/tree/dev/pg_bm25" +license = "AGPL-3.0" +description = "Full text search over SQL tables using the state-of-the-art BM25 algorithm" +homepage = "https://www.paradedb.com/" +documentation = "/~https://github.com/paradedb/paradedb/tree/dev/pg_bm25" +categories = ["search"] + +[dependencies] +apt = ["libc6"] + +[build] +postgres_version = "15" +platform = "linux/amd64" +dockerfile = "Dockerfile" +install_command = """ + cd paradedb/ + mv target/release/pg_bm25-pg15/usr/lib/postgresql/15/lib/* /usr/lib/postgresql/15/lib + mv target/release/pg_bm25-pg15/usr/share/postgresql/15/extension/* /usr/share/postgresql/15/extension +"""