Home
A blog about web development and Drupal.

search

February 23, 2015

Changing Link Texts in Solr Facets

In a recent post, I wrote about how we can group items in Solr search facets. This latest addition to the Solr post series will discuss how one can change the link text in Facet API’s Drupal blocks. Let’s assume I have a content type facet, as illustrated in the image below, and I wish to change the link text of the Discussion filter to Thread. Now, this sounds easy, right? One would think you could just implement hook\block\view\alter, and change the block’s content. However, this will turn out not to be the best approach. Even though this will allow you to manipulate the facet block’s…

November 29, 2014

Grouping Values in Apache Solr Facets

It is common nowadays for Drupal sites to offload search duties to Solr by employing the Apache Solr Search and Facet API modules. Working together, these two modules can automatically build search facets that display filters for various aspects of the content, such as the content type, or taxonomy terms. In certain cases, it might be necessary to influence the way those facets filter content. This post will discuss a scenario where we may want to group multiple filters together inside a facet block such that they only appear as one item. This method may be useful if the site has too many…

July 15, 2013

Paragraph Level Search Results with Solr

Apache Solr is a great alternative to Drupal’s built-in search engine. With the help of the Apache Solr contributed module, it is not even too difficult to get it up and running on any Drupal site. Even though Solr is a very sophisticated search platform with many features, there is one kind of functionality that it does not provide out of the box: paragraph level search results. Imagine that there is an article with very extensive content that could spread across multiple pages if it was printed in a book (like this blog post). Let’s suppose a site visitor searches for a keyword that is…