I am faced with a challenge for my company's new website. We are using Drupal 7 and here is the situation: We have approximately 250 doctors in our group and I am tasked with creating a custom search page where users can search our doctors based on certain criteria (e.g. specialty, gender, location, etc.).

I have created a content type of "doctor" and entered all of the physician data that will be needed. My question is: how is the best way to go about setting up the search that I want to give my visitors? I would assume that I need to restrict a search based on content type, but how can I throw the additional search parameters in there? Are there some modules that give very granular options like I'm looking for, or am I looking at having to create and code a custom module??

I'm a little lost and any direction would be very helpful.

2 Answers 2


You will need to make use of the views module to create the functionality you are looking for.

  • Create a new display of type page

  • Then select show content of type [Your content type]

  • Add fields you want users to be able to search on

  • Create filters and expose the filters

  • Thanks @4life. I will give it a go and see how it works.
    – gev125
    May 20, 2013 at 16:08

i am sure this is so easy option rather than generating a view .

/** nice snipet to restrict search content type **/

   function mymodule_search_query_search_node_alter(&$query) {
   $query->condition('n.type', 'article', '=');

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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