From aa8f38f58666a5cd6c8ac38c2c939f81b1a70c7c Mon Sep 17 00:00:00 2001 From: Alex Tharp Date: Wed, 19 Apr 2017 12:00:04 -0500 Subject: [PATCH 1/2] fix: explicitly specify all ES field mappings for Webpage index --- app/models/concerns/searchable_webpage.rb | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/app/models/concerns/searchable_webpage.rb b/app/models/concerns/searchable_webpage.rb index 79559ea94..c87d36284 100644 --- a/app/models/concerns/searchable_webpage.rb +++ b/app/models/concerns/searchable_webpage.rb @@ -5,12 +5,31 @@ module SearchableWebpage include Searchable mapping do - indexes :id, :type => :integer, :index => :not_analyzed - indexes :tenant_id, :type => :integer, :index => :not_analyzed indexes :name, :analyzer => :snowball indexes :url, :analyzer => :keyword + indexes :dynamic_yield_sku, :analyzer => :keyword + indexes :dynamic_yield_category, :analyzer => :keyword indexes :created_by, :analyzer => :keyword indexes :created_at, :type => :date, :include_in_all => false + indexes :deleted_at, :type => :date, :include_in_all => false + indexes :updated_at, :type => :date, :include_in_all => false + + indexes :id, :type => :integer, :index => :not_analyzed + indexes :tenant_id, :type => :integer, :index => :not_analyzed + indexes :user_id, :type => :integer, :index => :not_analyzed + indexes :thumbnail_file_name, :type => :string, :index => :not_analyzed + indexes :thumbnail_content_type, :type => :string, :index => :not_analyzed + indexes :thumbnail_file_size, :type => :long, :index => :not_analyzed + indexes :thumbnail_updated_at, :type => :date, :index => :not_analyzed + indexes :seo_title, :type => :string, :index => :not_analyzed + indexes :seo_description, :type => :string, :index => :not_analyzed + indexes :noindex, :type => :boolean, :index => :not_analyzed + indexes :nofollow, :type => :boolean, :index => :not_analyzed + indexes :nosnippet, :type => :boolean, :index => :not_analyzed + indexes :noodp, :type => :boolean, :index => :not_analyzed + indexes :noarchive, :type => :boolean, :index => :not_analyzed + indexes :noimageindex, :type => :boolean, :index => :not_analyzed + indexes :tables_widget, :type => :string, :index => :not_analyzed end def as_indexed_json(options = {}) From a5a0f473d3c6beb061ec55fbc7b3b1906179b0d8 Mon Sep 17 00:00:00 2001 From: Alex Tharp Date: Wed, 19 Apr 2017 12:09:36 -0500 Subject: [PATCH 2/2] fix: disable indexing of Webpages tables_widget field --- app/models/concerns/searchable_webpage.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/concerns/searchable_webpage.rb b/app/models/concerns/searchable_webpage.rb index c87d36284..d0aa48c93 100644 --- a/app/models/concerns/searchable_webpage.rb +++ b/app/models/concerns/searchable_webpage.rb @@ -29,7 +29,7 @@ module SearchableWebpage indexes :noodp, :type => :boolean, :index => :not_analyzed indexes :noarchive, :type => :boolean, :index => :not_analyzed indexes :noimageindex, :type => :boolean, :index => :not_analyzed - indexes :tables_widget, :type => :string, :index => :not_analyzed + indexes :tables_widget, :type => :nested, :enabled => false end def as_indexed_json(options = {})