From 27c4dbedf220f2a5212cd73bf84b9f5f75227bbd Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sun, 9 Sep 2018 12:18:50 +1200 Subject: [PATCH] Elasticsearch has dropped the string type and is now using text --- app/models/crop.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/models/crop.rb b/app/models/crop.rb index b1d492353..9710952a0 100644 --- a/app/models/crop.rb +++ b/app/models/crop.rb @@ -78,18 +78,18 @@ class Crop < ActiveRecord::Base } do mappings dynamic: 'false' do indexes :id, type: 'long' - indexes :name, type: 'string', analyzer: 'gs_edgeNGram_analyzer' - indexes :approval_status, type: 'string' + indexes :name, type: 'text', analyzer: 'gs_edgeNGram_analyzer' + indexes :approval_status, type: 'text' indexes :scientific_names do indexes :name, - type: 'string', + type: 'text', analyzer: 'gs_edgeNGram_analyzer', # Disabling field-length norm (norm). If the norm option is turned on(by default), # higher weigh would be given for shorter fields, which in our case is irrelevant. norms: { enabled: false } end indexes :alternate_names do - indexes :name, type: 'string', analyzer: 'gs_edgeNGram_analyzer' + indexes :name, type: 'text', analyzer: 'gs_edgeNGram_analyzer' end end end