freelancing-god/thinking-sphinx — Issue #320: Sphinx's internal attribute '@rank' doesn't work
Author: janko-m
Created: 2011-12-18 21:03:58+00:00
State: open

I have a normal

@songs = Song.search(params[:search], :page => params[:page], per_page => 10)

When I add `:order => "@rank ASC"`, nothing changes. So, if I switch between DESC and ASC, it is supposed to give me results in reverse orders, but it always gives me in the same order. It works with one of my columns, or with other Sphinx's internal attributes (like `@random`), but `@rank` (`@relevance`, `@weight`) doesn't work.

Also, `:rank_mode => :sph04` doesn't work. I'm sure I did everything right. I have "Lol Rofl Lmao" and "Lol Rofl", and when I type "lol rofl", I still get "Lol Rofl Lmao" first (because his ID is lower than "Lol Rofl"'s). I don't know if it's a Sphinx's thing, but I'm sure didn't make any mistakes.

An insteresting thing. I accidentally put `:rank_mode => :phrase` (I forgot to change `:rank_mode` to `:match_mode`), and it acted as if I had used `:match_mode`. When I typed "lol rofl lmao", it didn't find "Lol Rofl", only "Lol Rofl Lmao". Maybe this will help.