]> git.cworth.org Git - sup/commitdiff
xapian: fix issue with empty ferret query
authorRich Lane <rlane@club.cc.cmu.edu>
Tue, 28 Jul 2009 03:19:30 +0000 (20:19 -0700)
committerWilliam Morgan <wmorgan-sup@masanjin.net>
Tue, 28 Jul 2009 16:00:52 +0000 (12:00 -0400)
lib/sup/ferret_index.rb

index 63c0169349f3e021556cf4f957ab513e9a5f7460..5bacef834a6b97a0350036d64c15663ae027ea12 100644 (file)
@@ -430,6 +430,7 @@ private
 
   def build_ferret_query query
     q = Ferret::Search::BooleanQuery.new
+    q.add_query Ferret::Search::MatchAllQuery.new, :must
     q.add_query query[:qobj], :must if query[:qobj]
     labels = ([query[:label]] + (query[:labels] || [])).compact
     labels.each { |t| q.add_query Ferret::Search::TermQuery.new("label", t.to_s), :must }