Core searches

Categories

Component ID

200544

Component name

Core searches

Component type

module

Development status

Component security advisory coverage

not-covered

Downloads

6311

Component created

Component changed

Component body

Synopsis

Provides a patch to remove content and user search from Drupal core, leaving only the search framework. Provides two new modules, contentsearch and usersearch, which replace the functionality that has been removed. This allows you to turn content or user search off, if you don't want to have them.

Philosophy

The search module in core Drupal provides a general framework for indexing and searching. It does not provide any search functionality on its own. This is, in principle, a great idea, because core or contributed modules can then introduce their own search implementations. In fact, the user module and the node module each have such implementations, and these are where the content and user search tabs come from. The problem is that both node and user module are required by Drupal to run, so we are left with no way to get rid of these core content and user searches. This discourages other contributed modules from using the search module framework because any further implementations have to take their place in line behind the core content and user searches.

This project consists of a patch and two modules. The patch removes the node and user module search implementations, leaving only the search module framework behind. The two modules, usersearch and content search, replace the functionality that the patch removes, in the form of contributed modules. The advantage gained is the ability to choose which, if either, of the content or user searches you want to enable. It could be that you have a custom search implementation from another module and you wish for it to be the only search available. If that is the case, this is the right module for you.

You may also want to check out the Suppress Search module which addresses the same problem.

Installation

Step 1:
You must begin by applying the patch:

# start from the root of your drupal installation
cd
/path/to/drupal

patch -p0 < sites/all/modules/coresearches/searches.patch
# here you'll have to type in the paths to the node, search and user modules
# eg: modules/node/node.module

Step 2 (Optional):
enable the contentsearch and/or the usersearch module.

Aliases

Please note that the paths for core content and user searches will become invalid after applying the patch, and that enabling the two modules will result in the following new paths to the respective searches:

  • search/contentsearch
  • search/usersearch

There is no upgrade path for your URL Aliases at this point, so if you have aliased q=search/node or q=search/user you will have to manually update these aliases.