Re: [ts] Custom sort by multiple parameters.

53 views
Skip to first unread message

Pat Allan

unread,
Nov 5, 2012, 5:21:56 AM11/5/12
to thinkin...@googlegroups.com
Hi Mike

Would be happy to help, but your gist has been deleted. Care to send us another link?

--
Pat

On 05/11/2012, at 11:07 AM, Mike C. wrote:

> I'm stuck on implementing some custom sort filters with Thinking Sphinx and hoping someone out there can help me figure this one out.
>
> I have an ajax search page that allows you to search by, Name, Category and Tags (via acts_as_taggable) this is currently working fine. What I'm finding difficult to implement is the additional search filters. I am unclear on the best approach to implement this:
>
> 1. Most/Least Viewed
> 2. Highest/Lowest Rating (via thumbs_up)
> 3. Most/Least Reviews (via a comments model)
> 4. Time Frame (Day, Week, Month, Year)
>
> Here is what I have so far, it is quite long and could probably be refactored and shrunk a lot, uploading a GIST to show the code with nicer formatting. After it works I'll upload a public Thinking Sphinx test app with credits to anyone that can help me get this working, it will help me a ton and anyone else looking for more complex TS examples.
>
> Here is the Gist
>
>
> --
> 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/-/alA0w94gsT4J.
> To post to this group, send email to thinkin...@googlegroups.com.
> To unsubscribe from this group, send email to thinking-sphi...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/thinking-sphinx?hl=en.


Mike C.

unread,
Nov 5, 2012, 9:31:02 AM11/5/12
to thinkin...@googlegroups.com
Sorry for the deletion, I thought it looked a little jumbled mess and figured it would he easier to build the test app and just put the repo up before asking the question hehe. I'll repost when I have it up =)

Mike C.

unread,
Nov 5, 2012, 9:36:24 AM11/5/12
to thinkin...@googlegroups.com
Also my search condition was so long and not structured that great. I just posted a new topic with my current Name, Tag and Skill/Category search method. I think it can be changed to have skill indexed with the Person/Group, instead of indexing the Skill model and the SharingSkill model, than I can add it into the single search option instead of chaining searches down the page as I had previously done. Once I figure out that issue, it will probably be easier to figure out the other search filters on attributes by declaring each one as filters{} using the :with => filters call on my search.

Mike C.

unread,
Nov 6, 2012, 10:49:07 AM11/6/12
to thinkin...@googlegroups.com
actually the filtering was much easier than I thought. I made a variable called order_by and can just pass parameters to it from each filter button.
Reply all
Reply to author
Forward
0 new messages