Closed (won't fix)
Project:
Search API sorts
Version:
7.x-1.x-dev
Component:
Documentation
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
3 May 2012 at 23:13 UTC
Updated:
5 Sep 2013 at 09:56 UTC
Jump to comment: Most recent
Comments
Comment #1
mkalbere commentedI had no time to do that in a clean way, so
in search_api_solr/service.inc ~l 555
Replace
by
Comment #2
dtarc commentedI would like to do something like this too. Here's the use case we're looking for:
If no search terms have been entered, sort alphabetically by node title ascending.
If search terms have been entered, sort by relevance descending.
It seems that this module does not yet support this.
Perhaps I will try the same strategy as mkalbere although I would like something cleaner. Does anybody have any suggestions on how to start? Thanks.
Comment #3
Anonymous (not verified) commentedOk so these are two different issues.
Issue #1: Sort by X, then sort by Y, then sort by Z (hierarchical sorts) - I have no plans to implement this at the moment, it will add a lot of complexity to the extension. If you really need this, then please go ahead and custom hack into the module like #1 did.
Issue #2: Two default search preference, a) when search terms are present; b) when NO search terms are present.
I feel inclinded to add this feature indeed, but please submit a patch for it and I will consider it for sure.
I have created a separate issue for #2: #1637794: Add default sort for when NO search terms are present, and when they are
Closing this thread for #1, I will not implement that feature.
Comment #4
strykaizerI fixxed this in a custom module implementing hook_search_api_query_alter
Note: my 2nd sort is hardcoded, so no need for extra logic for me.