Search order by publish date or custom field I wan't to order my search result first by publish date (or my custom date field), and then by relevance.
Recently posted on Content ranking are not working.
How to do this?
I assume you are using the core Search module. For this kind of functionality I prefer using the excellent Search API module. There are other modules as well such as Solr but with increased complexity.

The core search module indexes only node title and body. Using the module not only allows you to index other fields but also to present the results in any fashion by creating a custom view with the Views module.

In order to use Search API, you need a backend such as the Search API DB module. This needs to be installed and activated along with Search API as well.

In order to create a custom page of results:


Create a search server in Search API configuration
Create an index with all relevant fields THAT you are going to use in the view (next) as well
Create a new view of type index
Add an exposed filter 'Fulltext Search' if you wish
Add any fields you wish to present, usually the rendered entity field (teaser)
Sort by any field you prefer to.