mirror of https://github.com/apache/lucene.git
Allow suggest field to be configured with a suggest_field option to the flare method
git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@540684 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
4bddbd8363
commit
6bd5301ed5
|
@ -18,8 +18,14 @@ module Flare
|
|||
end
|
||||
|
||||
module ClassMethods
|
||||
#
|
||||
|
||||
def flare(options={})
|
||||
include Flare::ActionControllerExtensions::InstanceMethods
|
||||
|
||||
cattr_accessor :suggest_field
|
||||
self.suggest_field = options[:suggest_field] || 'text'
|
||||
|
||||
before_filter :flare_before
|
||||
end
|
||||
end
|
||||
|
@ -38,13 +44,12 @@ module Flare
|
|||
end
|
||||
|
||||
def facet
|
||||
logger.debug "---- facet: #{params[:field]}"
|
||||
@facets = @flare.retrieve_field_facets(params[:field])
|
||||
end
|
||||
|
||||
def auto_complete_for_search_query
|
||||
# TODO instead of "text", default to the default search field configured in schema.xml
|
||||
@values = @flare.retrieve_field_facets("text", 5, params['search']['query'].downcase)
|
||||
@values = @flare.retrieve_field_facets(self.class.suggest_field, 5, params['search']['query'].downcase)
|
||||
|
||||
render :partial => 'suggest'
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue