15

I am having drupal 7 site with search enabled. I want to restrict the search to a particular content type/types, by excluding which types i dont want to appear in the result. How can i do this?

And can i also disable the advance search feature? Are there any module for this?

14

I guess that Custom Search module can help you: http://drupal.org/project/custom_search. acording Custom Search module description:

The module adds options to select:

* which content type(s) to search

here a snapshot of Custom Search settings related with content type configuration:

enter image description here

Other alternative seems to be Search Configuration module http://drupal.org/project/search_config that give to Search settings (in Additional Node Search Configuration > Only of the type(s) settings) options to filter search by content type:

enter image description here

5

you could just add a view with the title as an "exposed filter". Then you can limit the search to certain nodes.

5

Drupal's contrib module Search Restrict is a lightweight module that just does the basics - it allows administrators to restrict by role who can search for each content type.

From the module's page:

Approach of this module is to re-write the search query, so that content is indexed and available as search results to users in role(s) that have permissions to view it, but not displayed to other roles. Integrates with Apache Solr to exclude results based on the role of the person searching.

Simply download, install, and enable the module. Then to restrict (by role) which users can search which content types, edit each Content Type individually and there will now be a 'Search Restrict' section option (below the Display Settings). It allows you to specific, for each content type, which roles can search nodes of that content type.

1

My evaluated best solution uses all content types in search config and lets you exclude the unwanted types: https://www.lullabot.com/articles/hiding-content-from-drupals-search-system

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.