diff --git a/plugins/elasticsearch/controllers/elasticsearch_plugin_controller.rb b/plugins/elasticsearch/controllers/elasticsearch_plugin_controller.rb index 64dd7f6..15c6c01 100644 --- a/plugins/elasticsearch/controllers/elasticsearch_plugin_controller.rb +++ b/plugins/elasticsearch/controllers/elasticsearch_plugin_controller.rb @@ -28,7 +28,13 @@ class ElasticsearchPluginController < ApplicationController query = {} unless text.blank? - fields = klass::SEARCHABLE_FIELDS.map {|k, v| "#{k}^#{v[:weight]}"} + fields = klass.indexable_fields.map do |key, value| + if value[:weight] + "#{k}^#{v[:weight]}" + else + "#{k}" + end + end query = { query: { -- libgit2 0.21.2