Hi there

You should be able to get this working - the problem is that you've got it 
defined within a string, and so it's treated as a SQL snippet, instead of a 
proper column reference. So, you should change it to the following:
  has score

This also has the benefit of TS being able to determine the type automatically, 
and you don't need to give it an alias (unless you want to).

TS isn't able to know whether a SQL snippet is updated, but it can check 
whether a column is updated, and therefore it can update the Sphinx attribute 
accordingly.

Hope this helps!

-- 
Pat

On 28/10/2010, at 2:08 PM, djfobbz wrote:

> i have a listings table that contains about 400k records and i am
> indexing the following way:
> 
> define_index do
>               indexes :name, :sortable => true
>               indexes "REPLACE(listings.name, \"'\", '')", :as
> => :name_without_chars
>               indexes :description
>               indexes [:city, :state], :as => :city_state
>               indexes :zip, :as => :zipcode
>               indexes [category_1.name, category_2.name, category_3.name], :as
> => :categories
>               has [category_id_1, category_id_2, category_id_3, category_id_4,
> category_id_5, category_id_6], :as => :category_syph_codes
>       
> has :id, :metro_code, :type_id, :dt_today_count, :dt_week_count, 
> :dt_month_count, :sort_order_weight
>               has "listings.score", :as => :listing_score, :type => :integer
>               has "RADIANS(listings.latitude)",  :as => :latitude,  :type
> => :float
>               has "RADIANS(listings.longitude)", :as => :longitude, :type
> => :float
>               where "listings.temporary = 0"
>               set_property(:morphology => 'stem_en')
>               set_property(:enable_star => true)
>               set_property(:min_infix_len => 3)
> end
> 
> listing_score is a constantly updating integer attribute.  since
> listing_score is an integer attribute, shouldn't sphinx be able to
> sort it ASC or DESC at all times? even after it's updated?
> 
> -- 
> 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.
> 

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