diff --git a/plugins/elasticsearch/controllers/elasticsearch_plugin_controller.rb b/plugins/elasticsearch/controllers/elasticsearch_plugin_controller.rb index 18592da..77e4307 100644 --- a/plugins/elasticsearch/controllers/elasticsearch_plugin_controller.rb +++ b/plugins/elasticsearch/controllers/elasticsearch_plugin_controller.rb @@ -33,7 +33,7 @@ class ElasticsearchPluginController < ApplicationController def get_query text, klass query = {} unless text.blank? - + text = text.downcase fields = klass::SEARCHABLE_FIELDS.map do |key, value| if value[:weight] "#{key}^#{value[:weight]}" diff --git a/plugins/elasticsearch/lib/ext/article.rb b/plugins/elasticsearch/lib/ext/article.rb new file mode 100644 index 0000000..ff88a31 --- /dev/null +++ b/plugins/elasticsearch/lib/ext/article.rb @@ -0,0 +1,13 @@ +require_dependency 'article' +require_relative '../elasticsearch_indexed_model' + +class Article + include ElasticsearchIndexedModel + + def self.control_fields + [ + :advertise, + :published, + ] + end +end -- libgit2 0.21.2