I have a Listings model that has description (text) and website
(string) columns along with corresponding has_description (boolean) &
has_website (boolean) columns to give precedence (0 for not present
and 1 for present) during search time accordingly.  I have defined
these boolean columns as integer to allow be to sort them ASC or DESC
based on 1 or 0.  My index setup is as below:

define_index do
  has :has_description, :type => :integer
  has :has_website, :type => :integer
  set_property(:morphology => 'stem_en')
  set_property(:ignore_chars => 'U+0027')
  set_property(:enable_star => true)
end

Search Code:
@listings = Listing.search(params[:q], :order => "has_description
DESC, has_website DESC, name ASC, population DESC", :page => params
[:page])

My problem is that when I have both has_description and has_website as
columns to sort by, I get no results back.  However, when I just list
1 or the other as below:

@listings = Listing.search(params[:q], :order => "has_description
DESC, name ASC, population DESC", :page => params[:page])

I get search results.  Any ideas why?

--

You received this message because you are subscribed to the Google Groups 
"Thinking Sphinx" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/thinking-sphinx?hl=en.


Reply via email to