views:

44

answers:

1

Hello,

How to customize standard search behavior in Drupal 6? I need search results to be sorted by date. In example, people want to show items within 2 past weeks or something like that.

I've tried a lot things on this reference without luck. Have you ever encountered such problem? Any help will b appreciated. Thanks!

+1  A: 

You can sort by date using search solutions like Apache Solr. But I understand you want to use standard Drupal search.

In that situation I would recommend using the faceted search module http://drupal.org/project/faceted_search

Faceted Search module does not require the installation of a separate search engine. It also has views integration which will allow you to do thinks like show results from last 2 weeks and so on.

Please see: http://drupalcode.org/viewvc/drupal/contributions/modules/faceted_search/README.txt?view=co

You can search for "views" in the above document for information.

You can choose to also not show any facets if you don't want your users to see them. In that case you would be installing the module only because of the benefits of views integration.

Sid NoParrots
@NoParrots, thank you very much! Although I've written my own module with `do_search()`.
Darmen