14560: Only index the first 1M bytes of ft-searchable data.
[arvados.git] / services / api / app / models / arvados_model.rb
index cc15a56f35325f56ea5762c050aa4494f5e5a5d4..74d1d950763ded3fe8bc18acfa050df84bf07da1 100644 (file)
@@ -403,7 +403,7 @@ class ArvadosModel < ActiveRecord::Base
       cast = serialized_attributes[column] ? '::text' : ''
       "coalesce(#{column}#{cast},'')"
     end
-    "to_tsvector('english', #{parts.join(" || ' ' || ")})"
+    "to_tsvector('english', substr(#{parts.join(" || ' ' || ")}, 0, 1000000))"
   end
 
   def self.apply_filters query, filters