Implementing a more robust (fuzzy?) search in existing production application

I realize that this isn’t totally a phoenix/elixir question, but I am asking in the context of phoenix/elixir and the available libraries. This is out of my lane, but I am guessing some libraries use solid tech to solve the existing problem.

We have an app that is currently in production. In the end, it simply presents PDFs for clients to download. Each record has some metadata and some classifying data about the PDF.

There is a VERY rudimentary search; think LIKE %<term>% on a few data rows.

We want to expand this search ability to do something like:

  • Search more thoroughly across several columns.
  • Index the PDFs and search them too.

For example, the search for “a flock of blue herons” would yield results for records where indexed fields or text in indexed PDFs had text like the following:

  • Blue herons often flock on the edge of cliffs.
  • Herons are sometimes blue and often flock together.
  • A blue heron by himself is not a flock.

I am not looking for anything more than suggestions for existing elixir/phoenix libraries to use.

Any pointers would be appreciated.

Have you taken a look at Postgres full text search? I keep meaning to in my application but I have not used it yet, though I used a similar feature in SQL Server many years ago. You can build a type of index that includes multiple columns, can do partial/fuzzy searches and it ranks results. This article seems decent: Understanding PostgreSQL Full Text Search: 10 Critical Aspects

I’m not sure about searching binary PDFs, you might have to extract text and store that to make it searchable by Postgres.

OH! this looks good! let me take a look at this. thanks!

I am planning to include search, command pallete, from the get go. Here are some open source alternatives to Algolia:

3 Likes
6 Likes