All Low add-ons are now owned by EEHarbor. Read the blog post.

Support archive

Order by collection with additional param to sort each collection by score or entry_date

thoughtful_web 29 Apr 2015 09:33 question, complete

Hi Low,

We‘ve been using Low Search on a number of websites with great success, so thanks for building such a great add-on. Of course, there is always one client that requests something a little more challenging so I am hoping you can help.

Our client’s website uses both Low Search and Low Events (current versions). We had originally split the search so the user can either search events only or search the rest of the site, however, the client would like the global search to include events.

As Low Events copies the Start and End date to the native entry_date and expiration_date fields we were hopeful we could just use the orderby parameter set to entry_date, but the client wants the events to be displayed in ascending order which pushes the events to the end of the results.

So we decided to use the orderby collection option using:

collection="events|pages|artists" 
orderby="low_search_collection:events,pages,artists"
sort="desc|asc|asc"


This works great but the results are ordered by relevance/score. It would be great of we could order the collections choosing either score or entry_date. Something like...

collection="events|pages|artists" 
orderby="low_search_collectionevents|entry_date,pages|score,artists|score"
sort="desc|asc|asc"


I’m pretty sure this is not currently possible, but could this be done?

Thanks,

Simon

Replies

  1. Low 29 Apr 2015 11:51

    I'm afraid advanced ordering like that isn't possible at the moment. You'd have to create an extension for stuff like that. However, even with an extension, the ordering you describe will be quite hard to achieve, if at all.

  2. thoughtful_web 29 Apr 2015 11:59

    Thanks for your prompt reply.

    When you say 'hard to achieve', are you implying it is not even worth trying?

    The reason I ask is my client will undoubtedly enquire about the possibility of commissioning you to make this update. We certainly don’t have the skills in-house. So, I guess, my question is twofold: Could it be done? Would you consider doing the work?

  3. Low 29 Apr 2015 12:06

    Well, in theory, anything could be done with the right amount of time and effort.

    Low Search currently isn't equipped to mix custom ordering (like score and LE entry date) without changing some inner workings. Sure, that can be commissioned, but you're looking at a couple of days of work at least, I think.

  4. thoughtful_web 29 Apr 2015 12:13

    Ha ha. I use that 'anything could be done with the right amount of time and effort' line all the time with my clients, except I replace the word effort with money. It’s the first time I’ve been on the receiving end.

    Okay. I’ll send you an email so you can share with me your day rate (rather than publish it here) as it would be good if I could offer my client a guide price so they can make the decision.

    Thanks

    Simon