0

I have two books in my website (Drupal 7) and i am using Solr search.

I want to implement book specific search so that, if user is searching for Book1 content then it should show results from Book1 and not from Book2 and also let me know how to provide option of Book1 and Book2 near search bar so that we can filter the results.

I didnt find any module for this in drupal.Please provide me suggestions.

0

If you are familiar with views this can be done with the following steps.

We have a contributed module for apache solr views, by installing this module you can change the views module to apache solr views i.e you can route the queries from database queries to apache solr.

Working example :

Step 1:

Download and install the apache solr views module. Installing Apache solr views

Once the module is installed the following steps is equivalent to creating a normal view with an exposed filters.

Step 2:

Create a new view I have named book search (I have created a normal menu for the book search and added in the views path configuration i.e : " Path: /apachesolrfilters ", you can create a stand alone page or add it to any existing blocks), add fields and filters,

Fields : I have added content title, body & content type Filters: I have added Content: Published (Yes), Content: Type (exposed) & Content: Title (exposed)

Adding Filters

Configure the filter content type to show only the book types book1 & book2.

Configuring the filters

Save the view and clear the cache.

Screen shot:

Screen shot

  • Thanks for the reply i will try this solution. Also i am looking in book_search module in drupal 6 which is used for book specific search. – Akshay Sawant Dec 20 '13 at 7:22

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.