.. _solr_tutorial:
Apache Solr Tutorial
====================
This tutorial demonstrates how to use the App-Schema plugin with a Apache Solr data store. This tutorial will focus on the Apache Solr data store specific aspects, and the `App-Schema documentation <_app-schema>`_ should be read first.
The use case for this tutorial will be to serve through App-Schema the information about some meteorological stations index in an Apache Solr core. Note that this use case is completely fictional and only used to demonstrate the Apache Solr and App-Schema integration.
A station data is composed of some meta-information about the station, e.g. it's name and position. The only extra \ different configuration we need to provide when using Apache Solr as a data source is the configuration of the data store itself.
Apache Solr data source configuration as a specific syntax and allow us to specify geometry attributes and to explicitly set the default geometry:
.. code-block:: xml
stations
http://localhost:8983/solr/stations
location
4326
POINT
In this particular case the the ``location`` attribute contains a point geometry and will be the default geometry.
The complete mapping file is:
.. code-block:: xml
st
http://www.stations.org/1.0
gml
http://www.opengis.net/gml/3.2
stations
http://localhost:8983/solr/stations
location
4326
POINT
stations.xsd
stations_solr
stations
stations
st:Station
st:Station
station_id
st:stationName
station_name
st:position
station_location
The mappings for the attributes are straightforward and follow the normal App-Schema attributes mappings syntax. Currently multi valued fields are not supported.