5796: omit file_names column from collections search index.
authorRadhika Chippada <radhika@curoverse.com>
Thu, 23 Apr 2015 16:10:05 +0000 (12:10 -0400)
committerRadhika Chippada <radhika@curoverse.com>
Thu, 23 Apr 2015 16:10:05 +0000 (12:10 -0400)
services/api/db/migrate/20150423145759_no_filenames_in_collection_search_index.rb [new file with mode: 0644]
services/api/db/structure.sql
services/api/test/unit/arvados_model_test.rb

diff --git a/services/api/db/migrate/20150423145759_no_filenames_in_collection_search_index.rb b/services/api/db/migrate/20150423145759_no_filenames_in_collection_search_index.rb
new file mode 100644 (file)
index 0000000..7b52abd
--- /dev/null
@@ -0,0 +1,9 @@
+class NoFilenamesInCollectionSearchIndex < ActiveRecord::Migration
+  def up
+    remove_index :collections, :name => 'collections_search_index'
+    add_index :collections, ["owner_uuid", "modified_by_client_uuid", "modified_by_user_uuid", "portable_data_hash", "uuid", "name"], name: 'collections_search_index'
+  end
+
+  def down
+  end
+end
index 61fc1ae214701752926923ae826d49144eb5e6f6..a86de697388401a8c0e4739ecb60b92c23546d85 100644 (file)
@@ -432,8 +432,8 @@ CREATE TABLE jobs (
     docker_image_locator character varying(255),
     priority integer DEFAULT 0 NOT NULL,
     description character varying(524288),
-    state character varying(255),
-    arvados_sdk_version character varying(255)
+    arvados_sdk_version character varying(255),
+    state character varying(255)
 );
 
 
@@ -1316,7 +1316,7 @@ CREATE INDEX collections_full_text_search_idx ON collections USING gin (to_tsvec
 -- Name: collections_search_index; Type: INDEX; Schema: public; Owner: -; Tablespace: 
 --
 
-CREATE INDEX collections_search_index ON collections USING btree (owner_uuid, modified_by_client_uuid, modified_by_user_uuid, portable_data_hash, uuid, name, file_names);
+CREATE INDEX collections_search_index ON collections USING btree (owner_uuid, modified_by_client_uuid, modified_by_user_uuid, portable_data_hash, uuid, name);
 
 
 --
@@ -2374,4 +2374,6 @@ INSERT INTO schema_migrations (version) VALUES ('20150312151136');
 
 INSERT INTO schema_migrations (version) VALUES ('20150317132720');
 
-INSERT INTO schema_migrations (version) VALUES ('20150324152204');
\ No newline at end of file
+INSERT INTO schema_migrations (version) VALUES ('20150324152204');
+
+INSERT INTO schema_migrations (version) VALUES ('20150423145759');
\ No newline at end of file
index 0418a94510d9e046564cd5b49db5f659bd194330..6918aa0d00058b4d6183e92c89506aacb45a3f85 100644 (file)
@@ -131,7 +131,7 @@ class ArvadosModelTest < ActiveSupport::TestCase
         search_index_columns = table_class.searchable_columns('ilike')
         # Disappointing, but text columns aren't indexed yet.
         search_index_columns -= table_class.columns.select { |c|
-          c.type == :text or c.name == 'description'
+          c.type == :text or c.name == 'description' or c.name == 'file_names'
         }.collect(&:name)
 
         indexes = ActiveRecord::Base.connection.indexes(table)