2
votes

On my Drupal 7 site, I am trying to switch from using the core Search module to the Search API module.

How can I add a search term filter to my views using the "Search views" module? The "Search views" module claims it integrates the Search API module with the Views module, but I cannot find any search term filter to add when I edit my views. How do I get this to work?

I have the following modules installed on Drupal 7:

  • Search API (7.x-1.0)
  • Database search (7.x-1.0-beta2)
  • Search pages (7.x-1.0-beta2)
  • Search views (7.x-1.0)
  • Views (7.x-3.3) Views UI (7.x.3.3)

I have disabled the following core module:

  • Search (7.12)

In the Search API, I have created a Server (using the Database search module) and two Indexes. I ran the cron job several times, created a search page (using the Search pages module), and tested my indexes. They seem to work. So how can I connect my Views to Search API using "Search views"?

1

1 Answers

3
votes

It took me awhile to figure it out since I had named the search index "Content" which was a bad idea. I have since renamed it to "Content Index".

After you have created your server and index in the search api, it will automatically create a new View type. Her are the basic steps

  1. Add new view
  2. Under "show" you should see "Content Index" or the name of your search api index.
  3. Now add the applicable fields (Title, description, author, relevance, etc)
  4. Filter Criteria add "Search: Fulltext search" and expose it to allow your users to enter search terms.
  5. Give the page a url and a title
  6. Try the new search page.

I also found this video walk through which helped, it wasn't exact since it's filmed with an early version of search api and views. https://vimeo.com/15556855