Skip to content
Snippets Groups Projects

Application limit for ES indexed field length

Merged Dylan Griffith requested to merge 201826-es-field-length-limit into master
12 files
+ 101
1
Compare changes
  • Side-by-side
  • Inline
Files
12
  • 2c2c823d
    Using the plan_limit table we can down store a limit for the maximum
    size of any fields being indexed in Elasticsearch. This is for
    #201826 . Any strings above
    the length limit will be truncated down to the limit.
    
    We default to 0 which means unlimited so this has no affect for
    self-managed customers. On GitLab.com we will likely want to set this to
    around 20k as a sensible upper limit on what we should store.
# frozen_string_literal: true
class AddElasticsearchIndexedFieldLengthLimitToApplicationSettings < ActiveRecord::Migration[6.0]
DOWNTIME = false
def up
add_column :application_settings, :elasticsearch_indexed_field_length_limit, :integer, null: false, default: 0
if Gitlab.com?
execute 'UPDATE application_settings SET elasticsearch_indexed_field_length_limit = 20000'
end
end
def down
remove_column :application_settings, :elasticsearch_indexed_field_length_limit
end
end
Loading