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

可否提供安装了zhparser的pgvector镜像? #84

Open
wencan opened this issue Jun 18, 2024 · 1 comment
Open

可否提供安装了zhparser的pgvector镜像? #84

wencan opened this issue Jun 18, 2024 · 1 comment

Comments

@wencan
Copy link

wencan commented Jun 18, 2024

rag 中文 混合搜索需要vector 和 文本搜索
https://docs.llamaindex.ai/en/latest/examples/vector_stores/postgres/
pgvector项目已经提供了pgvector镜像

@liuwb
Copy link

liuwb commented Sep 6, 2024

You can use following dockerfile to build the postgresql image with pgvector&zhparser extension.

ARG PG_MAJOR=16

FROM postgres:$PG_MAJOR as builder

RUN set -ex
&& apt-get update
&& apt-get install -y --no-install-recommends build-essential git ntp ca-certificates autoconf automake libtool m4 postgresql-server-dev-$PG_MAJOR

RUN set -ex
&& git clone https://github.com/hightman/scws.git
&& cd scws
&& touch README;aclocal;autoconf;autoheader;libtoolize;automake --add-missing
&& ./configure
&& make install

RUN set -ex
&& git clone https://github.com/amutu/zhparser.git
&& cd zhparser
&& make install

FROM pgvector/pgvector:0.7.2-pg16

COPY --from=builder /usr/lib/postgresql/${PG_MAJOR}/lib/zhparser.so /usr/lib/postgresql/${PG_MAJOR}/lib/
COPY --from=builder /usr/local/lib/libscws.* /usr/local/lib/
COPY --from=builder /usr/share/postgresql/${PG_MAJOR}/extension/zhparser* /usr/share/postgresql/${PG_MAJOR}/extension/
COPY --from=builder /usr/lib/postgresql/${PG_MAJOR}/lib/bitcode/zhparser* /usr/lib/postgresql/${PG_MAJOR}/lib/bitcode/
COPY --from=builder /usr/share/postgresql/${PG_MAJOR}/tsearch_data/.utf8. /usr/share/postgresql/${PG_MAJOR}/tsearch_data/

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

No branches or pull requests

2 participants