Commit 5007c9709ea43a32e7c0cc1f5c3ea20b1a928725

Authored by Arthur Sturzbecher
Committed by Macartur Sousa
1 parent 73cbed60

Elasticsearch: fixes for search mapping

plugins/elasticsearch/controllers/elasticsearch_plugin_controller.rb
... ... @@ -33,7 +33,7 @@ class ElasticsearchPluginController < ApplicationController
33 33 def get_query text, klass
34 34 query = {}
35 35 unless text.blank?
36   -
  36 + text = text.downcase
37 37 fields = klass::SEARCHABLE_FIELDS.map do |key, value|
38 38 if value[:weight]
39 39 "#{key}^#{value[:weight]}"
... ...
plugins/elasticsearch/lib/ext/article.rb 0 → 100644
... ... @@ -0,0 +1,13 @@
  1 +require_dependency 'article'
  2 +require_relative '../elasticsearch_indexed_model'
  3 +
  4 +class Article
  5 + include ElasticsearchIndexedModel
  6 +
  7 + def self.control_fields
  8 + [
  9 + :advertise,
  10 + :published,
  11 + ]
  12 + end
  13 +end
... ...