Skip to content

Commit

Permalink
re work param handling for solr query
Browse files Browse the repository at this point in the history
  • Loading branch information
lancepantz committed Sep 15, 2012
1 parent af67b02 commit a3737d6
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/model_set/solr_query.rb
Expand Up @@ -35,8 +35,8 @@ def use_core!(core)
@core = core
end

def select_fields!(*fields)
@select = fields.flatten
def solr_params!(opts)
@opts = opts
end

def id_field
Expand All @@ -50,8 +50,9 @@ def id_field
private

def fetch_results
params = {:q => "#{conditions.to_s}"}
params[:fl] = @select || [id_field]
params = @opts || {}
params[:q] = "#{conditions.to_s}"
params[:fl] ||= [id_field]
params[:wt] = :json
if limit
params[:rows] = limit
Expand Down

0 comments on commit a3737d6

Please sign in to comment.