-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fuzzy searching functionality backend
- Loading branch information
1 parent
8899da5
commit 040b9e7
Showing
3 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# log lines will bump the console prompt down. | ||
if function_exported?(Mix, :__info__, 1) and Mix.env() == :dev do | ||
# if statement guards you from running it in prod, which could result in loss of logs. | ||
Logger.configure_backend(:console, device: Process.group_leader()) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
defmodule Accumulator.Repo.Migrations.NotesSearch do | ||
use Ecto.Migration | ||
|
||
def change do | ||
execute(""" | ||
CREATE EXTENSION IF NOT EXISTS pg_trgm; | ||
""") | ||
|
||
execute(""" | ||
CREATE INDEX notes_searchable_idx ON notes USING GIN (text gin_trgm_ops); | ||
""") | ||
end | ||
end |