-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
I added text fields to the data set views to enable aggregation around text values in charts. I also added a new index for each text field so that we can perform full text search later. For now, we're doing nothing with it, but later we can start using it as the indexes will be there and populated moving forward. This will require another migration to enable the Postgres Trigram extension. We will also have to do manual migrations to rebuild the views: ```elixir ids = MetaActions.list(ready_only: true) |> Enum.map(& &1.id) ids |> Enum.map(&MetaActions.get/1) |> Enum.each(&DataSetActions.down!/1) ids |> Enum.map(&MetaActions.get/1) |> Enum.each(&DataSetActions.up!/1) ids |> Enum.map(&MetaActions.get/1) |> Enum.each(&PlenarioEtl.import_data_set_on_demand/1) ``` Updates #264
- Loading branch information
Vince Forgione
committed
Jul 11, 2018
1 parent
9630494
commit 897d5a7
Showing
8 changed files
with
71 additions
and
13 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
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
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
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,3 @@ | ||
CREATE INDEX "<%= view_name %>_<%= field %>_tsvector" | ||
ON "<%= view_name %>" | ||
USING GIN ( to_tsvector('english', "<%= field %>") ) |
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,9 @@ | ||
defmodule Plenario.Repo.Migrations.EnablePgTrgm do | ||
use Ecto.Migration | ||
|
||
def up do | ||
execute """ | ||
CREATE EXTENSION IF NOT EXISTS pg_trgm; | ||
""" | ||
end | ||
end |