WHAT/WHERE search + Solr 3.6 + location(lat/lng) + radius based search

This doc will help you to

  • Modify schema.xml so that it supports geo location values
  • WHAT/WHERE search (radius based) - instead of a single keyword based search
  • Content-type based filtration
  • Implementation of hook_apachesolr_index_document_build, hook_apachesolr_query_alter

I am not going through the steps for installing / connecting solr with drupal. A lot of articles are already available online.


Typically for job/property search sites, where you have two text fields: WHAT and WHERE. I am using the apachesolr search pages for this implementation.
Example search:
WHAT: drupal architect
WHERE: Mumbai, Maharashtra, India
(basically, the 'where' is an autofill textbox - which gets data from YQL - and its cached when search is being repeated)


Using Sarnia to interact with external Solr data

This document refers to the 1.1 release (in beta) of the Sarnia module. Sarnia allows a Drupal site to interact with and display external data from Solr, mainly by building views of data from Solr. This is useful for large external datasets that either aren't practical to store in Drupal or that are already indexed in Solr.

Sarnia is also the name of a town in Ontario, Canada, home of the largest photovoltaic power plant in Canada.

Table of contents

  1. Installation
  2. Generating a Solr core for testing
  3. Configuring Search API
  4. Creating Views of Solr data
  5. Advanced Solr
  6. Advanced Entities


Sarnia depends on Search API, Search API Solr, and Search API Views. The full list of dependencies includes:

Installing Apache Solr on Windows 2008 with Jetty Running as a Service

Please note that this article was reproduced with permission from Bill Beckelman's website. The original article can be found here. This guide has been used succesfully with Drupal.

Initial Solr Setup

1. Install the latest Java JDK from http://www.oracle.com/technetwork/java/javase/downloads/index.html.
Make sure to select 64bit version if you need it.

Only local images are allowed. title="image" border="0" alt="image" src="/files/solr_windows_installation-1.png"
width="589" height="473">


2. Download Solr 1.4.1 from one of the mirrors at http://www.apache.org/dyn/closer.cgi/lucene/solr/
(at the time of writing, not all mirrors seem to be hosting 1.4.1, but most seem
to have at least 1.4.0)

Only local images are allowed. title="image" border="0" alt="image" src="/files/solr_windows_installation-2.png"
width="566" height="236">

3. Unzip the Solr download. You should have the files listed in the image
below. Open the example folder.

Only local images are allowed.

Manipulating Apache Solr search results using the QueryElevationComponent and elevate.xml

In order to use these directions, you must have access to the your Apache Solr installation including solrconfig.xml and elevate.xml.

By default, Apache Solr does not use the QueryElevationComponent (which enables the administrator to manipulate query results) in the default request handler. This page is a guide on how to use QueryElevationComponent to artificially promote nodes based on a search query.

Installing Solr on Apple - Mac OS X

Snow Leopard already has Java installed on it, so it's pretty straightforward installing Apache Solr on Mac OS X versions 10.6 and above.

For Solr 3.5.0 on drupal 7

Download Solr-3.5 from the Apache Archive here
Download the apachesolr module from https://drupal.org/project/apachesolr

Assuming the above folders are in the Downloads folder:


Subscribe with RSS Subscribe to RSS - Apache Solr