Hmm, if Sphinx doesn't like the sort statement, it doesn't return
anything. But it sounds like you're getting results, so it should be
doing the right thing.
The issue could be related to delta indexes? From memory, I think
Sphinx orders by index, *then* by attribute, so anything in the delta
comes after core. I'm not entirely sure of this, mind you, and there
should be ways around it by merging delta into core, but I was playing
with that last night and results weren't quite what I was expecting,
so it's not part of the public release just yet.
I will investigate further.
Cheers
--
Pat
On 01/01/2009, at 12:05 AM, Jörg Battermann wrote:
>
> Hola :)
>
> Quick Q: I just noticed that my search results are not sorted by
> created_at DESC, even though my options look like this:
>
> @search_options = {
> :page => (params[:page] || 1),
> :per_page => Question.per_page,
> :include => :user,
> :order => "created_at DESC",
> :match_mode => :extended
> }
>
> @questions = Question.search((params[:search] || ""), @search_options)
>
> The Index definition looks like this:
>
> define_index do
> indexes title, :sortable => true
> indexes cached_plaintext_question, :as => :question
> indexes answers.cached_plaintext_body, :as => :answers
> indexes cached_tag_list, :as => :tags
> indexes user.name, :as => :user
> indexes answered_by, user_id
>
> has created_at
> has answers(:id), :as => :answer_ids
>
> set_property :delta => true
> end
>
> :-/
>
> Any idea why this is happening?
>
> Cheers and happy new year to everyone! :)
>
> -J
> >
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---