Use Search API to get custom search results for Views

Use Search API to get custom search results for Views

Recently I was working on a Drupal website project that had to be rescued. The previous development team took various approaches to work on functionality that had to be put together. However, when we started to release features, the pieces of functionality could not be stitched together. A particular example (I wanted to talk about) relates to using Drupal Views and Search API modules in order to build search pages. Many developers who used Search API know that it provides nice views integration, allowing to build views that utilise Search API indexes and servers to display the desired search results, build and configure facets – all within the Views interface. Unfortunately, in this case, the search API was using a search index but the View that meant to be displaying search results using the Views’ Exposed filters option in combination with Better Exposed Filters module (to achieve Facet-like search experience). The end result was satisfactory from the display point of view, but lacking good logic in getting the correct search results. To avoid rebuilding the about to go-live search page, I decided to look into the way Search API module handles the search. This approach could be used to get the list […]

Continue reading