Ah, my mistake, got confused between EXPR/expression sort mode and extended. Use a lowercase -s flag: /usr/bin/search --config config/production.sphinx.conf -s "created_at DESC" --index question_core -e
Have a scan through the results, see if it's what you expect. -- Pat On 06/01/2009, at 8:04 AM, Jörg Battermann wrote: > > ------------ > /usr/bin/search --config config/production.sphinx.conf -S "created_at > DESC" --index question_core -e > Sphinx 0.9.8.1-release (r1533) > Copyright (c) 2001-2008, Andrew Aksyonoff > > using config file 'config/production.sphinx.conf'... > index 'question_core': search error: failed to create sorting queue: > unknown identifier 'desc' (not an attribute, not a function). > ------------ > > :-/ > > On Jan 4, 11:06 am, Pat Allan <[email protected]> wrote: >> Hi Jörg >> >> What's the output if you try a similar request using the search >> command-line tool? >> search --config config/development.sphinx.conf -S "created_at DESC" >> -- >> index question_core -e >> >> Cheers >> >> -- >> Pat >> >> On 04/01/2009, at 4:56 PM, Jörg Battermann wrote: >> >> >> >> >> >>> Good morning Pat, >> >>> I do have delta-indexing etc enabled, but the order is also 'wrong' >>> after doing a full reindex... >> >>> Let me know in case you need more data/input. >> >>> Cheers, >>> -J >> >>> On Jan 4, 7:44 am, Pat Allan <[email protected]> wrote: >>>> 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 -~----------~----~----~----~------~----~------~--~---
