Hello Jennifer, The spatial documentation is largely this page: https://cwiki.apache.org/confluence/display/solr/Spatial+Search (however note the online version is always for the latest Solr release. You can download a PDF versioned against your Solr version).
To do polygon searches, you both need to add the JTS jar (which you already did), and also to set the spatialContextFactory as the ref guide indicates -- that you have yet to do and is I think why you see that error. Another thing I see that looks like a problem is that you set geo=false, yet didn't set the worldBounds. Typically geo=true and you get the typical decimal degree +/- 180, +/- 90 box. But if you set false then the grid system needs to know the extent of your grid. ~ David On Thu, Aug 11, 2016 at 4:04 PM Jennifer Coston < jennifer.cos...@raytheon.com> wrote: > > Hello, > > I am trying to setup a local solr core so that I can perform Spatial > searches on it. I am using version 5.2.1. I have updated my schema.xml file > to include the location-rpt fieldType: > > <fieldType name="location_rpt" > class="solr.SpatialRecursivePrefixTreeFieldType" > geo="false" distErrPct="0.025" maxDistErr="0.001" > distanceUnits="degrees" /> > > And I have defined my field to use this type: > > <field name="positionWkt" type="location_rpt" indexed="true" > stored="true" /> > > I also added the jts-1.4.0.jar file to C:\solr-5.2.1\server\solr-webapp > \webapp\WEB-INF\lib. > > However when I try to add a document through the Solr Admin Console I am > seeing this response: > > { > "responseHeader": { > "status": 400, > "QTime": 6 > }, > "error": { > "msg": "Unknown Shape definition [POLYGON((-77.23 38.922, -77.23 > 38.923, -77.228 38.923, -77.228 38.922, -77.23 38.922))]", > "code": 400 > } > } > > I can submit documents successfully if I remove the positionWkt field. Did > I miss a configuration step? > > Here is the document I am trying to add: > > { > "observationId": "8e09f47f", > "observationType": "image", > "startTime": "2015-09-19T21:03:51Z", > "endTime": "2015-09-19T21:03:51Z", > "receiptTime": "2016-07-29T15:49:49.328Z", > "locationLat": 38.9225015078814, > "locationLon": -77.22900299194423, > "position": "38.9225015078814,-77.22900299194423", > "positionWkt": "POLYGON((-77.23 38.922, -77.23 38.923, -77.228 > 38.923, -77.228 38.922, -77.23 38.922))", > "provider": "a" > } > > Here are the fields I added to the schema.xml file (I started with the > template, please let me know if you need the whole thing): > > <uniqueKey>observationId</uniqueKey> > > <!-- MY FIELDS --> > <copyField source="observationId" dest="id"/> > <!-- 'id' field already defined above. no need to explicitly define again. > --> > <field name="observationId" type="string" indexed="true" stored="true" > required="true" multiValued="false"/> > <field name="observationType" type="string" indexed="true" stored="true"/> > <field name="startTime" type="tdate" indexed="true" stored="true"/> > <field name="endTime" type="tdate" indexed="true" stored="true"/> > <field name="receiptTime" type="tdate" indexed="true" stored="true"/> > <field name="locationLat" type="tfloat" indexed="true" stored="true"/> > <field name="locationLon" type="tfloat" indexed="true" stored="true"/> > <field name="position" type="location" indexed="true" stored="true"/> > <field name="positionWkt" type="location_rpt" indexed="true" > stored="true" /> > > Thank you! > > Jennifer -- Lucene/Solr Search Committer, Consultant, Developer, Author, Speaker LinkedIn: http://linkedin.com/in/davidwsmiley | Book: http://www.solrenterprisesearchserver.com