amy-jung / collectivedaoarchives.catalog

The Collective DAO Catalog is an open source index of DAO historical events. Together, as an open source database that anyone can contribute to, we can use the power of collective intelligence to highlight patterns and improve the development of new and existing DAOs
https://www.daocatalog.xyz/
MIT License
6 stars 1 forks source link

Add search v0 #24

Closed damianmarti closed 1 year ago

damianmarti commented 1 year ago

Search API endpoint at /search and working search feature at the home page.

The Prisma full-text search is not pretty complete -> https://github.com/prisma/prisma/issues/8950

I made the search with a queryRaw using the GIN index from PostgreSQL.

We have to decide if using the full-text feature from PostgreSQL is good enough or we should use some full-text engine.

I think the main issue with PostgreSQL's full-text feature is the limited and sometimes inefficient ranking, but maybe for our use case and document collection size, it's good enough.

Added search term headline to the search results:

localhost_3001_search_q=vote

closes #20

vercel[bot] commented 1 year ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
collectivedaoarchives-catalog ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 11, 2023 9:06pm
carletex commented 1 year ago

Great stuff @damianmarti

I saw that you switch to migrations

image

I was still using the db push to prototype, but I think this was a good moment to switch. I'll update the README accordingly (and also maybe the heroku-postbuild script to run migrate deploy)

I just ran it manually in the PROD database.

Merging this and I'll reimport the data.