Pat Allan wrote:
> As for delta indexes and sorting, yup, that's a limitation in Sphinx.  
> It calculates the ordinal values separately between indexes. There's  
> one way I've thought of fixing it, but Sphinx doesn't allow live  
> updates to the ordinal attributes, just normal ints, booleans and  
> timestamps.

I wrestled with this issue for a while and came up with a solution that
will suit some people, depending on the use case. Pat was kind enough to
merge it, so if it suits you it's available to use.

The search() method accepts a sql_order option, which will order the
matching results based on a field in your database instead of a field
in the sphinx index. If you're trying to sort by a string and you're
getting delta index records followed by main index records, this may
suit you.

An example from my codebase:

  Edition.search("some keywords", :sql_order => "`title`", :limit => 1000)

The one caveat is that the ordering is done on a per page basis. For a
HTML interface with pagination this behaviour is probably not what you
want.

In my case the search is for an order form with up to 1000 products, so
I'm not using pagination and the ordering is appropriate.

-- James Healy <jimmy-at-deefa-dot-com>  Wed, 11 Mar 2009 16:17:50 +1100

--~--~---------~--~----~------------~-------~--~----~
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