This document discusses geospatial search capabilities with Apache Solr. It defines geospatial search and geolocation, describes how to configure Drupal to support geospatial search with Solr through modules like search_api and location, and provides an example of custom coding needed to properly index and facet location fields for geospatial queries. Future improvements discussed include adding radius box search by city and visualizing search results on a map.
6. SOLR
Solr is the popular, blazing fast open source
enterprise search platform from the Apache
Lucene project.
Its major features include powerful full-text
search, hit highlighting, faceted search,
dynamic clustering, database integration, rich
document handling, and geospatial search.
Solr is written in Java
12. Geospatial search: definition
wikipedia:
Geomatics (also known as geospatial
technology or geomatics engineering) is the
discipline of gathering, storing, processing, and
delivering geographic information, or
spatially referenced information.
17. Geolocation: ground mark
Surveyor-General Victoria (SGV) is responsible
for Victoria’s Geodetic Survey Control Network.
This is the infrastructure used to provide
accurate position and height referencing across
Victoria. It is made up of 140,000 ground marks
http://www.dse.vic.gov.au/property-titles-and-
maps/surveying-home-page/government-
survey-services/victorias-survey-infrastructure
22. Drupal + SOLR
Nice tutorial:
http://www.nickveenhof.be/blog/simple-guide-
install-apache-solr-3x-drupal-7
Check his blog for screencasts:
http://www.nickveenhof.be/
24. Our Story
• Drupal site
• Using SOLR with apachesolr module
• Location module
Problem:
Location information wasn't indexed
25. Drupal: Location module
The Location module allows real-world
geographic locations to be associated with
Drupal nodes.
http://drupal.org/project/location
27. Why not indexed?
SOLR doesn't know what to do with this custom
field.
And this field contains multiple values (street,
city, province, country,...)
28. Solution
We wrote some custom code to:
• index location information properly
• generate facets
• provide a search form for geospatial search
(longitude, latitude + radius)
We changed schema.xml to use a
"solr.LatLonType" field.
30. Schema.xml?
The schema.xml file contains all of the details
about which fields your documents can
contain, and how those fields should be dealt
with when adding documents to the index, or
when querying those fields.
Schema.xml comes with the apachesolr
module and is configured to handle drupal
content.
31. Schema.xml?
<!-- A specialized field for geospatial search. If
indexed, this fieldType must not be multivalued.
-->
<fieldType name="location"
class="solr.LatLonType"
subFieldSuffix="_coordinate"/>
45. Future
• Adding city + radius box
• Getting coordinates of the city
• Search for items within that range
• Adding visualisation
• Settings UI: miles or km,…
What would you add? Let us know!
http://drupal.org/project/apachesolr_location