If you are using DIH, is just doing (for a mysql project I have around for
example) something like this:
CONCAT(lat, ',',lon) as latlon
--
View this message in context:
http://lucene.472066.n3.nabble.com/Solr-4-0-Spatial-Search-schema-xml-and-data-config-xml-tp4020376p4020437.html
Sent
The particular JavaScript I referred to is this:
function processAdd(cmd) {
doc = cmd.solrDoc; // org.apache.solr.common.SolrInputDocument
lat = doc.getFieldValue(LATITUDE);
lon = doc.getFieldValue(LONGITUDE);
if (lat != null lon != null)
doc.setField(latLon, lat+,+lon);
}
Howdy,
I now want to try my hand a spatial search. It looks fairly easy but I'm a
bit puzzled about how to set up my schema.xml file. I know that my field
must use the LatLon type but the columns of the database where I'll be
pulling my data for indexing have separate lat and lon columns (both
Tim,
Combine them in lat,lon format using ScriptUpdateRequestProcessor using
JavaScript. I'm doing this already in fact. See a template of an example
that comes with Solr in update-script.js referenced by solrconfig.xml. I'd
paste it right here if I had it but I have the excerpt for it on