Implementing a Basic Fuzzy Search with Rails
As we mentioned in Introduction, Shine will be sharing a database with an existing customer-facing application. The customer-search feature we’re building will search one of the tables in that database.
In the real-world, our database would already exist and we’d hook up to it directly. Since that’s not the case, we’ll need to simulate its existence by creating the table in Shine’s database. And, because we’ll use Postgres query performance optimization, our table is going to need a lot of data in it.
Setting Up the New Table and Data
If we were using an existing table, we wouldn’t need a migration—we could just create the Customer model and be done. That’s not the case (since this is an example ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access