Hello, Geoserver Users. In response to Francesco's very helpful email below (thank you, Francsesco) and other feedback, we have released an updated version of the SOLR community module.
The module allows Geoserver to connect to a SOLR store and send queries with the usual powerful 'q' and 'fq' search parameters to SOLR, and also instruct SOLR to perform a spatial query and return the results back to Geoserver, where they can then be fed out as WMS, WFS, KML, .etc. The scenario where this is particularly useful is when there are too many SOLR search results to be querying SOLR directly from javascript on a web client. Instead, you have your SOLR server and Geoserver closely connected - there is fast transfer of maybe millions of results from SOLR to Geoserver, the map is then rasterised on the Geoserver, and then sent as WMS to the web client. Andrea Aime has done some great work on the interface and also on how processing is done behind the scenes. This includes changing the SOLR set up in the Geoserver web admin tool so that by default, the entire SOLR store is queried - there is no longer a field in the store definition to specify a 'layer' field. If you want to restrict all searches in a particular layer to a subset of the data store, though, there is a field in the layer definition to define a CQL query. The downloads for the stable version of Geoserver and the matching SOLR module at the time of this email are .. http://sourceforge.net/projects/geoserver/files/GeoServer/2.8.0/geoserver-2.8.0-war.zip http://ares.boundlessgeo.com/geoserver/2.8.x/community-latest/geoserver-2.8-SNAPSHOT-solr-plugin.zip Andrea has also expanded the documentation to give instructions on how to set up SOLR, as well as Geoserver. http://docs.geoserver.org/latest/en/user/community/solr/index.html A reminder that you create a field of type 'location_rpt' to store spatial data (points, polygons or multipolygons) , and it is stor ed in SOLR in WKT format eg. POINT(141.123456 -32.654321) Regards, *DAVID COLLINS* | Senior Geoscientist Data Systems | Geoscience Information Systems | Geological Survey of NSW *Addr:* Trade & Investment NSW | 516 High Street | Maitland | NSW 2320 *Tel:* 02 4931 6699 *Email:* [email protected] <[email protected]> *Web:* *http://www.resourcesandenergy.nsw.gov.au/miners-and-explorers/geoscience-information <http://www.resourcesandenergy.nsw.gov.au/miners-and-explorers/geoscience-information>* On Wed, Jan 21, 2015 at 8:00 PM, Francesco Fornari <[email protected]> wrote: > Hello all, > in our company we use with success GeoServer and Apache Solr for several > project, but never togheter, so we tried to realize a proof of concept to > demonstrate that solr can be a good choice as data for lat/lon positions > managed by one of our projects (we are talking of the order of magnitude > of about two MILLION or more positions stored). > > We followed the guide that we found at: > http://docs.geoserver.org/latest/en/user/community/solr/index.html > > so we downloaded version 2.7-SNAPSHOT of GeoServer due to the fact that > the guide is intended for 2.7.x versions. > > We're using Solr version 4.10.3 (> than 4.8/4.9 written on the guide). > > We downloaded and successfully installed solr extension from > http://ares.boundlessgeo.com/geoserver/master/community-latest/ (we was > able to see Solr as possible datasource in GS admin page). > > Until now everithing seems to be ok, but we had to work hard to see that > "beautiful" little red squares representing our positions on the world > rectangle. > > And here comes first problems: > adding the "layer" or "categorization" field to ALL our solr documents to > satisfy the requirement of the plugin was not easy, but fortunately we was > "playing" with solr, so we was able to delete all created documents a > recreate them with an additional default field, in our case named "layer" > which default value is "positions", so when uploading new documents, if a > value for field "layer" is not provided the default value "positions" is > set. In Solr you can do this by defining a field in this way in schema.xml > file: > > <field name="layer" type="string" indexed="true" stored="true" > required="false" multiValued="false" default="positions" /> > > In our case was not a problem redefine the schema, but would be great if > the solr plugin of geoserver uses the "layer" field as optional filter > field and not as mandatory feature the user documents must provide. > > Always in schema.xml we have a field: > <field name="positionRpt" type="location_rpt" indexed="true" stored="true" > required="false" multiValued="false"/> > > where location_rpt is a type defined as: > <fieldType name="location_rpt" > class="solr.SpatialRecursivePrefixTreeFieldType" distErrPct="0.025" > maxDistErr="0.000009" units="degrees" > spatialContextFactory="com.spatial4j.core.context.jts.JtsSpatialContextFactory" > autoIndex="true" /> > > Remember that this is not the default "location_rpt" field that comes with > solr in bundle, we added the spatialContextFactory attribute, but to avoid > classNotFound exceptions on Solr startup you have to install Jts libraries > inside your solr web-inf/lib directory inside the war. > > Following various guide on the internet we found that rpt fields can be > write on solr product in different format: we used "longitude latitude" > (longitude first and latitude after separated by a space) format. (THIS IS > WRONG, read below for correct solution) > > All done Solr side.... for now...... > > And here comes the pain... in solr field configuration whe defined > locationRpt as a "Geometry" (but also with ALL other possible choices in > drop-down menu) but nothing: various exceptions both on solr output console > (while geoserver does spatial queries on it) and on geoserver console > (wrong geometry errors). > > The SOLUTION was to define positionRpt content in WKT syntax, so a > document with lat and lon values must have the rpt field expressed as > "POINT(latitude,longitude)", this is the syntax to express a point in WKT > language. > > And voilà! everithing worked, we was able to see ALL our positions on the > layer preview. > > Hoping to be helpful > Bye > > Francesco Fornari > Italian Software Engineer > > > > ------------------------------------------------------------------------------ > New Year. New Location. New Benefits. New Data Center in Ashburn, VA. > GigeNET is offering a free month of service with a new server in Ashburn. > Choose from 2 high performing configs, both with 100TB of bandwidth. > Higher redundancy.Lower latency.Increased capacity.Completely compliant. > http://p.sf.net/sfu/gigenet > _______________________________________________ > Geoserver-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/geoserver-users > > -- Blog: geofoss.net
------------------------------------------------------------------------------
_______________________________________________ Geoserver-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geoserver-users
