Commit Graph

9 Commits

Author SHA1 Message Date
Donal McBreen 3aa4a1a562 Shard the search index into 16 tables
Create search_index_0 to search_index_15 tables and shard each index by
account id. MySQL has no ability to pre-filter fulltext indexes by
another field so this is the best bet for improving performance.

Each fulltest index internally creates 11 sub tables (see
https://dev.mysql.com/doc/refman/8.4/en/innodb-fulltext-index.html) so
actually we have 192 tables in total here.

The search_index table name is generated dynamically based on the
account_id.
2025-11-17 09:12:17 -05:00
Donal McBreen e8abc66eba MySQL search
Add a single search_index table for full-text search of cards and
comments.

For the search there is a full-text index on the title and content
columns. The board_ids is also included in the table and accessible
board ids are pre-loaded and included in the search query. This allows
us to filter out inaccessible records before joining with other tables.

Right now the search is just using boolean search. This would give us
a bunch of syntax options
(see https://dev.mysql.com/doc/refman/8.4/en/fulltext-boolean.html)
except the search query filters those out.

I've removed the searchable_by method for now - everything is built
on the assumption that there's a single search index table and all data
must fit into it.

Queries are written in SQL, we don't have a SearchIndex ActiveRecord
model. That's because we'll likely want to shard the table and it will
be simpler to just keep with the raw SQL for that.

There's no stemming, highlighting or snippet extraction yet - we are
dumping the full description in the search results.

Data can be reindexed with the search:reindex rake task.
2025-11-17 09:12:17 -05:00
Mike Dalessio d41d50d52b Account.sole → Current.account
and some other de-tenant changes, including removing the controller
tenanting concerns
2025-11-17 09:11:40 -05:00
Jorge Manrubia 445ee48b0d Format 2025-11-04 05:07:26 +01:00
Jorge Manrubia 4e999eaf86 Use existing ARTENANT env var for selecting the tenant
Thanks Mike for the tip!
2025-11-03 15:04:06 +01:00
Jorge Manrubia ac507aa754 Add support for remote images in the seeding system 2025-11-02 09:24:38 +01:00
Jorge Manrubia e726335833 WIP for seeding accounts 2025-11-02 00:05:38 +01:00
Jorge Manrubia 218519d075 Configure letter opener 2025-08-26 10:21:13 +02:00
Kevin McConnell 564a0f48ae New Rails app 2024-06-21 13:19:56 +01:00