Hi guys,

may be somebody can help me out here:

because I cannot combine AR scopes and Sphinx scopes I sort the list by the 
taggings count.
When a tagging changes, it should actually influence the Tag List.

Does anybody has a clue?

Thanks a lot!

Rafael


tag.rb

  define_index do
    has "COUNT(taggings.id)", :as => :taggings_count, :type => :integer, 
:sortable => true
    join taggings

    indexes name, :sortable => true
    indexes description, :sortable => true

    set_property :field_weights => {
      :name => 70,
      :description => 5
    },
    :delta => true,
    :enable_star => 1
  end



tags_controller.rb

    @tags = Tag.search(search_param,
                         :retry_stale => true,
                         :match_mode => :extended,
                         :star => true,
                         :order => 'taggings_count desc'
                      ).
            page(params[:page]).per(28)


-- 
You received this message because you are subscribed to the Google Groups 
"Thinking Sphinx" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/thinking-sphinx/-/eCKZRr-sTOQJ.
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