This is a feature request for adding a Default sorting setting to the Sort by block at admin/build/block/configure/apachesolr_search/ Find below attached mockup to clarify.

Currently the results are default sorted by relevancy. Relevancy would stay the default fresh install setting. But this new setting would offer site administrators 5 default sorting options.
* Relevancy
* Title
* Type
* Author
* Date

I searched the issue queue and found various way to achieve this using code. This is great for developers. But adding this setting to the 'Sort by' block would improve usability for site administrators.

I would be happy to contribute testing.

Comments

budda’s picture

Is this the best option for the setting? I need to set date as the default so would be willing to write the code/patch to get this in -- IF -- its the best way? I'm only just dipping in to Solr development so not familiar with everything yet.

francewhoa’s picture

StatusFileSize
new38.67 KB

@budda: My vote goes for adding this setting to the 'Sort by' block configuration page under the 'Block specific settings' section. Find above attached mockup to clarify location. My reasoning for this is base on usability. I mean as a site administrator if I want to configure the 'Sort by' block this is the first place I would try. Plus other Apache Solr blocks have similar configuration at the same location. Such as 'Apache Solr Search: Filter by updated/changed date' block under admin/build/block/configure/apachesolr_search/changed. Find below screenshot to clarify location. Maybe some of this code could be re-use for the 'Default sorting' setting?

You're welcome to contribute a patch.

@all: What do you think about the default sorting' setting location and format? Your input is welcome.

pwolanin’s picture

This ought to be pretty easy - add it to: ?q=admin/build/block/configure/apachesolr/sort

Basically this should operate right before we call the (new) hook_apachesolr_prepare_query()

jpmckinney’s picture

Status: Active » Closed (duplicate)

Marking duplicate of #721258: Add ability to control default sort and cross-posting there, so we can all work in one issue.

dalin’s picture

I don't think adding it to the block controls is a good idea. It won't work if the site does not use that block. I think the control must be in the main admin UI.