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

Build haystack plugin for postgresql FTS #367

Open
fgregg opened this issue Apr 30, 2024 · 0 comments
Open

Build haystack plugin for postgresql FTS #367

fgregg opened this issue Apr 30, 2024 · 0 comments
Labels

Comments

@fgregg
Copy link
Member

fgregg commented Apr 30, 2024

Background

Managed elasticsearch is pretty expensive, and adds another service to interact with.

Postgres full text search (FTS) is pretty good, and we basically always already have a postgres database.

Django has good support for FTS, and we've used in the the past, but in our projects this has meant building custom search interfaces. It would be be able to use Haystack and have postgres be a backend for haystack.

Proposal

  1. A public repo of a hastack backend that is installable from github
  2. A migration document from using elasticsearch as the backend to using postgres

Notes on implementation

Haystack's SimpleBackend would be the starting point. Like that model, we would not implement the methods that are used to create the index, because we would handle those on the models, with GeneratedFields and SearchVectorFields.

SimpleBackend is very simple, and we would want to implement at least faceting, and maybe also "more like this".

Here are some notes on an implementation of facetting with postgres FTS that could be useful.

Here's an example of a third-party haystack backend that is a good bit more complicated than we need, but should give us some guidance on organizing the code and entry points.

@fgregg fgregg added the R&D label Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant