Skip to content

Commit

Permalink
Create gist index on full text search
Browse files Browse the repository at this point in the history
  • Loading branch information
domoritz committed Sep 3, 2012
1 parent 3f26a1c commit 6175b31
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ckanext/datastore/db.py
Expand Up @@ -209,9 +209,14 @@ def create_table(context, data_dict):

context['connection'].execute(sql_string)

# create index for faster full text search (indextes: gin or gist)
sql_index_string = 'create index "{0}_idx" ON "{0}" USING gist("_full_text")'.format(
data_dict['resource_id'])
context['connection'].execute(sql_index_string)

# create alias view
alias = data_dict.get('alias', None)
if alias:
# create alias view
sql_alias_string = u'create view "{alias}" as select * from "{main}"'.format(
main=data_dict['resource_id'], alias=alias
)
Expand Down

0 comments on commit 6175b31

Please sign in to comment.