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

Support archive

How to set the search result display order by collection then score?

Natacha 31 Jul 2012 02:15 question, complete

Hello,

I'm trying to use the Modifier value to sort my search results in collection order...
ie. I'd like to display 'Project' items first, then 'Profiles', then other pages.

This doesn't seem to work though - assigning '10' to the collection I want displayed first, followed by 9, 8, 7 to each additional collection makes no difference to the search results display order.

Any ideas on how else I might be able to get the result-set display order showing by collection?

Many thanks,
Natacha

Replies

  1. Low 31 Jul 2012 07:18

    The Modifier will only change the relevance score for keyword searches. That means a keyword search has to be executed in order to trigger the notifier modification. Then it will multiply the relevance score (calculated internally by MySQL) by the modifier, marking results from one collection as more important than another. However, it does not mean all results from collection A are above results from collection B.

    There is no real way to get both relevance ordering *and* custom ordering in the same result set. You could add multiple low_search:results to the page, one for each collection, but that would not play nice with pagination (or performance, for that matter).

  2. Natacha 2 Aug 2012 00:52

    Is there a way of sorting by collection rather than by relevance?
    Since sorting by collection is more important/appropriate for us.

    if not, perhaps this could be an option in a future release...

  3. Low 2 Aug 2012 06:29

    Well, currently you can order search results in any way you could regular items with the channel:entries tag. If there's no way to get the entries in the order you want that way, there isn't one either for the search results.

    I'll make a note of your feature request.