lib/flare/session.rb in flare-1.0.0 vs lib/flare/session.rb in flare-1.0.1
- old
+ new
@@ -65,10 +65,12 @@
:fields => '* score',
})
options.assert_valid_keys(:filter, :types, :page, :per_page, :limit, :fields, :order, :facet)
+ args << '*:*' if args.empty?
+
query = {
:q => args,
:fq => Array(options[:filter]).flatten,
:fl => options[:fields],
:start => start = (options[:page] -1) * options[:per_page],
@@ -90,11 +92,9 @@
if options[:types]
query[:fq] << Array(options[:types]).map {|type| "type:#{type}"}.join(" OR ")
end
-
- query[:q] = query.delete(:fq) if query[:q].blank?
::ActiveRecord::Base.logger.debug(<<-SOLR.squish)
\e[4;32mSolr Query:\e[0;1m
#{query[:q].join(', ')}
#{"(#{query[:fq].join(' AND ')})," if query[:fq] }