Hi,
I'm trying to remove duplicates from search results (code below) using
group_by. It seems to work, but it breaks ordering.
I'm wondering if there is a specificTS-way to accomplish this, or how
to solve the problem.
Thanks for any suggestions,
--
Adriano
define_index do
indexes title, :sortable => true
indexes author, :sortable => true
indexes summary, :sortable => true
indexes content, :sortable => true
indexes feed.channel.page_id, :as => :page_id
indexes feed.channel.status, :as => :channel_status
has published, created_at, guid
end
search query,
:conditions => { :page_id => page_id, :channel_status =>
Channel::STATUS[:active] },
:include => { :feed => { :channel =>
[:tool, :account] } },
:group_function => :attr,
:group_by => "guid",
:order => "published DESC",
:page => page_number,
:per_page => 10
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---