Watch videos with subtitles in your language, upload your videos, create your own subtitles! Click here to learn more on "how to Dotsub"

Better Search Results with Solr and Drupal 7

0 (0 Likes / 0 Dislikes)
Better Search Results with Solr and Drupal 7 with Joe Shindelar Hi. Welcome to the Drupalize.Me series on using Apache Solr to build super-fast, super-accurate and super-awesome search applications with Drupal 7. Solr is a Java-based application that provides an API for interacting with Apache Lucene via HTTP in order to facilitate the creation of applications for performing full text searches of content, with a special focus on internet-based search applications. The quick pitch for why you should use Solr— it's insanely fast, especially when compared with Drupal's default search module. It can be scaled to handle millions of search queries per second and huge piles of data. Twitter, for example, uses it to do just that. It's better at finding the best results, because it's designed specifically to be a search application, and it works well with faceted searches, and best of all, it's open source, so it fits in well with the Drupal ecosphere and Drupal projects base. In this series, we'll take a more in-depth look at various capabilities of Solr and talk about how they can be best used in conjunction with data stored in a Drupal-based site. Because Solr is an application in and of itself, we're going to need to set up a Solr server with a single Solr core for storing our indexed data. For our production site, we're going to look at how you might host Solr on an Ubuntu-based server as part of a larger web infrastructure and walk through installing things like Java and Tomcat and Solr itself, and generally talk about best practices for setting all those things up. In a lot of cases, you might already be hosting with a provider that has Solr integrated into their network, and you can simply connect your production site to their Solr service. No need to set everything up yourself. And that's a great way to get started with Solr, but you'll probably still want to be able to do some local development to test things out— see what happens when you change configuration, etcetera— and to do so in a safe and sandboxed area. Luckily, running a single instance of Solr for a development environment is super easy. Download a few files and run a couple commands in your terminal, and bam—you've got a server. We'll go over that setup as well, so that you're prepared to do development on your local host. Since Solr is a third-party application, we need a way to bridge the gap between Solr and Drupal, and really, there's two parts to this puzzle. Getting the data out of Drupal and into Solr so that it can be processed and indexed, and passing a search query from Drupal to Solr in order to retrieve and display search results. There's also two key parts to the solution— the Search API module and the Search API Solr module. The Search API module takes on the responsibility of understanding Drupal and the specifics of our site's content, what, of all that data, should be indexed for searching, and any special considerations for handling different field types, like big blobs of text versus integers, versus dates. In this series, we'll look at configuring a new index for our site and walk through each of the various options that are available to us when doing so. We'll also talk about using boost values to influence the relevancy of search results based on the field in which the keywords are located and how to promote or sponsor results for specific keywords, some of which is done in the Search API module's configuration, and some of which we'll do directly in the Solr server's configuration. The Search API module is awesome, because it creates this generic index configuration that describes what to index and when, but it doesn't actually do any of the indexing on its own. Instead, it exposes the ability for other modules to provide one or more service classes that can be used to translate between what Search API knows about your data and your search appliance of choice. The nice thing is, this means we're not necessarily tied to using Solr, and could pretty easily switch to Elasticsearch or Xapian or one of the many other indexers available without having to change much configuration. We'll use the Search API Solr module to configure a connection between our Solr server and Drupal, so that the Search API module can send content to Solr for indexing and retrieve search results from Solr once someone performs a query. Throughout this series, we're going to be using some sample data that I've assembled about fish. The hypothetical scenario is that you're working for the local DNR. You've got a Drupal site that contains a giant database of fish, and you've just been asked to improve the speed and relevancy of search results performed on the site. Your data also contains extensive information that can be used to filter search results, so you would also like to be able to provide faceted search capabilities and some other bonus features as well. By the end of this series, you should be able to install and configure Apache Solr to act as a search indexer for Drupal, use the Search API and Search API Solr modules to connect Drupal to a Solr server and create amazing search experiences, all within Drupal.

Video Details

Duration: 5 minutes and 13 seconds
Country: United States
Language: English
License: All rights reserved
Genre: None
Views: 44
Posted by: drupalizeme on Apr 28, 2015

Better Search Results with Solr and Drupal 7

Caption and Translate

    Sign In/Register for Dotsub to translate this video.