You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Jennifer Coston <Je...@raytheon.com> on 2016/08/11 20:04:16 UTC

Need Help Resolving Unknown Shape Definition Error

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

Re: Need Help Resolving Unknown Shape Definition Error

Posted by Jennifer Coston <Je...@raytheon.com>.
Thanks David! I have updated my fieldType to be:

<fieldType name="location_rpt"
class="solr.SpatialRecursivePrefixTreeFieldType"
        geo="true" distErrPct="0.025" maxDistErr="0.001"
distanceUnits="degrees"

spatialContextFactory="com.spatial4j.core.context.jts.JtsSpatialContextFactory" />

And the queries seem to be working now!

Thanks again!

Jennifer



From:	David Smiley <da...@gmail.com>
To:	solr-user@lucene.apache.org
Date:	08/15/2016 11:48 PM
Subject:	Re: Need Help Resolving Unknown Shape Definition Error



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.Coston@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

Re: Need Help Resolving Unknown Shape Definition Error

Posted by David Smiley <da...@gmail.com>.
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.Coston@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

Re: Need Help Resolving Unknown Shape Definition Error

Posted by Jennifer Coston <Je...@raytheon.com>.
I figured out the solution to this and figured I would send out the
solution in case anyone else runs into this issue and stumbles across this.
It turns out that I was using an outdated version of the jts jar. When I
updated to version 1.14 it works.

Thanks,

Jennifer Coston



From:	Jennifer Coston <Je...@raytheon.com>
To:	solr-user@lucene.apache.org
Date:	08/12/2016 09:34 AM
Subject:	Re: Need Help Resolving Unknown Shape Definition Error



Update: I get the same error when I try to use curl instead of the admin
console. I'm really stuck on this. Any help, tips, suggestions, etc. would
be greatly appreciated!

Curl Command:
curl -X POST -H 'Content-Type: application/json'
'http://localhost:8983/solr/spaceknow/update/json/docs' --data-binary
'{"observationId":"8e09f47f", "observationType":"spaceknow",
"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"}'

Response:
curl -X POST -H 'Content-Type: application/json'
'http://localhost:8983/solr/spaceknow/update/json/docs' --data-binary
'{"observationId":"8e09f47f", "observationType":"spaceknow",
"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":"dg"}'

Full Schema.xml file:
<?xml version="1.0" encoding="UTF-8" ?>
<!--
 Licensed to the Apache Software Foundation (ASF) under one or more
 contributor license agreements.  See the NOTICE file distributed with
 this work for additional information regarding copyright ownership.
 The ASF licenses this file to You under the Apache License, Version 2.0
 (the "License"); you may not use this file except in compliance with
 the License.  You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
-->

<schema name="example" version="1.5">

   <field name="_version_" type="long" indexed="true" stored="true"/>
   <field name="_root_" type="string" indexed="true" stored="false"/>
   <field name="id" type="string" indexed="true" stored="true"
required="true" multiValued="false" />

   <dynamicField name="*_i"  type="int"    indexed="true"  stored="true"/>
   <dynamicField name="*_is" type="int"    indexed="true"  stored="true"
multiValued="true"/>
   <dynamicField name="*_s"  type="string"  indexed="true"
stored="true" />
   <dynamicField name="*_ss" type="string"  indexed="true"  stored="true"
multiValued="true"/>
   <dynamicField name="*_l"  type="long"   indexed="true"  stored="true"/>
   <dynamicField name="*_ls" type="long"   indexed="true"  stored="true"
multiValued="true"/>
   <dynamicField name="*_t"  type="text_general"    indexed="true"
stored="true"/>
   <dynamicField name="*_txt" type="text_general"   indexed="true"
stored="true" multiValued="true"/>
   <dynamicField name="*_en"  type="text_en"    indexed="true"
stored="true" multiValued="true"/>
   <dynamicField name="*_b"  type="boolean" indexed="true" stored="true"/>
   <dynamicField name="*_bs" type="boolean" indexed="true" stored="true"
multiValued="true"/>
   <dynamicField name="*_f"  type="float"  indexed="true"  stored="true"/>
   <dynamicField name="*_fs" type="float"  indexed="true"  stored="true"
multiValued="true"/>
   <dynamicField name="*_d"  type="double" indexed="true"  stored="true"/>
   <dynamicField name="*_ds" type="double" indexed="true"  stored="true"
multiValued="true"/>
   <dynamicField name="*_coordinate"  type="tdouble" indexed="true"
stored="false" />
   <dynamicField name="*_dt"  type="date"    indexed="true"
stored="true"/>
   <dynamicField name="*_dts" type="date"    indexed="true"  stored="true"
multiValued="true"/>
   <dynamicField name="*_p"  type="location" indexed="true" stored="true"/>
   <dynamicField name="*_ti" type="tint"    indexed="true"  stored="true"/>
   <dynamicField name="*_tl" type="tlong"   indexed="true"  stored="true"/>
   <dynamicField name="*_tf" type="tfloat"  indexed="true"  stored="true"/>
   <dynamicField name="*_td" type="tdouble" indexed="true"  stored="true"/>
   <dynamicField name="*_tdt" type="tdate"  indexed="true"  stored="true"/>
   <dynamicField name="*_c"   type="currency" indexed="true"
stored="true"/>
   <dynamicField name="ignored_*" type="ignored" multiValued="true"/>
   <dynamicField name="attr_*" type="text_general" indexed="true"
stored="true" multiValued="true"/>
   <dynamicField name="random_*" type="random" />

    <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" />

    <fieldType name="string" class="solr.StrField"
sortMissingLast="true" />
    <fieldType name="boolean" class="solr.BoolField"
sortMissingLast="true"/>
    <fieldType name="int" class="solr.TrieIntField" precisionStep="0"
positionIncrementGap="0"/>
    <fieldType name="float" class="solr.TrieFloatField" precisionStep="0"
positionIncrementGap="0"/>
    <fieldType name="long" class="solr.TrieLongField" precisionStep="0"
positionIncrementGap="0"/>
    <fieldType name="double" class="solr.TrieDoubleField" precisionStep="0"
positionIncrementGap="0"/>
    <fieldType name="tint" class="solr.TrieIntField" precisionStep="8"
positionIncrementGap="0"/>
    <fieldType name="tfloat" class="solr.TrieFloatField" precisionStep="8"
positionIncrementGap="0"/>
    <fieldType name="tlong" class="solr.TrieLongField" precisionStep="8"
positionIncrementGap="0"/>
    <fieldType name="tdouble" class="solr.TrieDoubleField"
precisionStep="8" positionIncrementGap="0"/>
    <fieldType name="date" class="solr.TrieDateField" precisionStep="0"
positionIncrementGap="0"/>
    <fieldType name="tdate" class="solr.TrieDateField" precisionStep="6"
positionIncrementGap="0"/>
    <fieldType name="binary" class="solr.BinaryField"/>
    <fieldType name="random" class="solr.RandomSortField" indexed="true" />
    <fieldType name="text_ws" class="solr.TextField"
positionIncrementGap="100">
      <analyzer>
        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
      </analyzer>
    </fieldType>
    <fieldType name="text_general" class="solr.TextField"
positionIncrementGap="100">
      <analyzer type="index">
        <tokenizer class="solr.StandardTokenizerFactory"/>
        <filter class="solr.StopFilterFactory" ignoreCase="true"
words="stopwords.txt" />
        <filter class="solr.LowerCaseFilterFactory"/>
      </analyzer>
      <analyzer type="query">
        <tokenizer class="solr.StandardTokenizerFactory"/>
        <filter class="solr.StopFilterFactory" ignoreCase="true"
words="stopwords.txt" />
        <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt"
ignoreCase="true" expand="true"/>
        <filter class="solr.LowerCaseFilterFactory"/>
      </analyzer>
    </fieldType>
    <fieldType name="text_en" class="solr.TextField"
positionIncrementGap="100">
      <analyzer type="index">
        <tokenizer class="solr.StandardTokenizerFactory"/>
        <filter class="solr.StopFilterFactory"
                ignoreCase="true"
                words="lang/stopwords_en.txt"
                />
        <filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.EnglishPossessiveFilterFactory"/>
        <filter class="solr.KeywordMarkerFilterFactory"
protected="protwords.txt"/>
        <filter class="solr.PorterStemFilterFactory"/>
      </analyzer>
      <analyzer type="query">
        <tokenizer class="solr.StandardTokenizerFactory"/>
        <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt"
ignoreCase="true" expand="true"/>
        <filter class="solr.StopFilterFactory"
                ignoreCase="true"
                words="lang/stopwords_en.txt"
                />
        <filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.EnglishPossessiveFilterFactory"/>
        <filter class="solr.KeywordMarkerFilterFactory"
protected="protwords.txt"/>
        <filter class="solr.PorterStemFilterFactory"/>
      </analyzer>
    </fieldType>
    <fieldType name="text_en_splitting" class="solr.TextField"
positionIncrementGap="100" autoGeneratePhraseQueries="true">
      <analyzer type="index">
        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
        <filter class="solr.StopFilterFactory"
                ignoreCase="true"
                words="lang/stopwords_en.txt"
                />
        <filter class="solr.WordDelimiterFilterFactory"
generateWordParts="1" generateNumberParts="1" catenateWords="1"
catenateNumbers="1" catenateAll="0" splitOnCaseChange="1"/>
        <filter class="solr.LowerCaseFilterFactory"/>
        <filter class="solr.KeywordMarkerFilterFactory"
protected="protwords.txt"/>
        <filter class="solr.PorterStemFilterFactory"/>
      </analyzer>
      <analyzer type="query">
        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
        <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt"
ignoreCase="true" expand="true"/>
        <filter class="solr.StopFilterFactory"
                ignoreCase="true"
                words="lang/stopwords_en.txt"
                />
        <filter class="solr.WordDelimiterFilterFactory"
generateWordParts="1" generateNumberParts="1" catenateWords="0"
catenateNumbers="0" catenateAll="0" splitOnCaseChange="1"/>
        <filter class="solr.LowerCaseFilterFactory"/>
        <filter class="solr.KeywordMarkerFilterFactory"
protected="protwords.txt"/>
        <filter class="solr.PorterStemFilterFactory"/>
      </analyzer>
    </fieldType>
    <fieldType name="text_en_splitting_tight" class="solr.TextField"
positionIncrementGap="100" autoGeneratePhraseQueries="true">
      <analyzer>
        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
        <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt"
ignoreCase="true" expand="false"/>
        <filter class="solr.StopFilterFactory" ignoreCase="true"
words="lang/stopwords_en.txt"/>
        <filter class="solr.WordDelimiterFilterFactory"
generateWordParts="0" generateNumberParts="0" catenateWords="1"
catenateNumbers="1" catenateAll="0"/>
        <filter class="solr.LowerCaseFilterFactory"/>
        <filter class="solr.KeywordMarkerFilterFactory"
protected="protwords.txt"/>
        <filter class="solr.EnglishMinimalStemFilterFactory"/>
        <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
      </analyzer>
    </fieldType>
    <fieldType name="text_general_rev" class="solr.TextField"
positionIncrementGap="100">
      <analyzer type="index">
        <tokenizer class="solr.StandardTokenizerFactory"/>
        <filter class="solr.StopFilterFactory" ignoreCase="true"
words="stopwords.txt" />
        <filter class="solr.LowerCaseFilterFactory"/>
        <filter class="solr.ReversedWildcardFilterFactory"
withOriginal="true"
           maxPosAsterisk="3" maxPosQuestion="2"
maxFractionAsterisk="0.33"/>
      </analyzer>
      <analyzer type="query">
        <tokenizer class="solr.StandardTokenizerFactory"/>
        <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt"
ignoreCase="true" expand="true"/>
        <filter class="solr.StopFilterFactory" ignoreCase="true"
words="stopwords.txt" />
        <filter class="solr.LowerCaseFilterFactory"/>
      </analyzer>
    </fieldType>
    <fieldType name="alphaOnlySort" class="solr.TextField"
sortMissingLast="true" omitNorms="true">
      <analyzer>
        <tokenizer class="solr.KeywordTokenizerFactory"/>
        <filter class="solr.LowerCaseFilterFactory" />
        <filter class="solr.TrimFilterFactory" />
        <filter class="solr.PatternReplaceFilterFactory"
                pattern="([^a-z])" replacement="" replace="all"
        />
      </analyzer>
    </fieldType>
    <fieldType name="lowercase" class="solr.TextField"
positionIncrementGap="100">
      <analyzer>
        <tokenizer class="solr.KeywordTokenizerFactory"/>
        <filter class="solr.LowerCaseFilterFactory" />
      </analyzer>
    </fieldType>
    <fieldType name="ignored" stored="false" indexed="false"
multiValued="true" class="solr.StrField" />
    <fieldType name="point" class="solr.PointType" dimension="2"
subFieldSuffix="_d"/>

<fieldType name="location" class="solr.LatLonType"
subFieldSuffix="_coordinate"/>

    <fieldType name="location_rpt"
class="solr.SpatialRecursivePrefixTreeFieldType"
        geo="false" distErrPct="0.025" maxDistErr="0.001"
distanceUnits="degrees" />

    <fieldType name="bbox" class="solr.BBoxField"
               geo="true" distanceUnits="kilometers"
numberType="_bbox_coord" />
    <fieldType name="_bbox_coord" class="solr.TrieDoubleField"
precisionStep="8" docValues="true" stored="false"/>

    <fieldType name="currency" class="solr.CurrencyField" precisionStep="8"
defaultCurrency="USD" currencyConfig="currency.xml" />
</schema>

Thanks!
      Jennifer Coston



Jennifer Coston ---08/11/2016 04:04:31 PM---Hello, I am trying to setup a
local solr core so that I can perform Spatial

From: Jennifer Coston <Je...@raytheon.com>
To: solr-user@lucene.apache.org
Date: 08/11/2016 04:04 PM
Subject: Need Help Resolving Unknown Shape Definition Error




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


Re: Need Help Resolving Unknown Shape Definition Error

Posted by Jennifer Coston <Je...@raytheon.com>.
Update: I get the same error when I try to use curl instead of the admin
console. I'm really stuck on this. Any help, tips, suggestions, etc. would
be greatly appreciated!

Curl Command:
curl -X POST -H 'Content-Type: application/json'
'http://localhost:8983/solr/spaceknow/update/json/docs' --data-binary
'{"observationId":"8e09f47f", "observationType":"spaceknow",
"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"}'

Response:
curl -X POST -H 'Content-Type: application/json'
'http://localhost:8983/solr/spaceknow/update/json/docs' --data-binary
'{"observationId":"8e09f47f", "observationType":"spaceknow",
"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":"dg"}'

Full Schema.xml file:
<?xml version="1.0" encoding="UTF-8" ?>
<!--
 Licensed to the Apache Software Foundation (ASF) under one or more
 contributor license agreements.  See the NOTICE file distributed with
 this work for additional information regarding copyright ownership.
 The ASF licenses this file to You under the Apache License, Version 2.0
 (the "License"); you may not use this file except in compliance with
 the License.  You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
-->

<schema name="example" version="1.5">

   <field name="_version_" type="long" indexed="true" stored="true"/>
   <field name="_root_" type="string" indexed="true" stored="false"/>
   <field name="id" type="string" indexed="true" stored="true"
required="true" multiValued="false" />

   <dynamicField name="*_i"  type="int"    indexed="true"  stored="true"/>
   <dynamicField name="*_is" type="int"    indexed="true"  stored="true"
multiValued="true"/>
   <dynamicField name="*_s"  type="string"  indexed="true"
stored="true" />
   <dynamicField name="*_ss" type="string"  indexed="true"  stored="true"
multiValued="true"/>
   <dynamicField name="*_l"  type="long"   indexed="true"  stored="true"/>
   <dynamicField name="*_ls" type="long"   indexed="true"  stored="true"
multiValued="true"/>
   <dynamicField name="*_t"  type="text_general"    indexed="true"
stored="true"/>
   <dynamicField name="*_txt" type="text_general"   indexed="true"
stored="true" multiValued="true"/>
   <dynamicField name="*_en"  type="text_en"    indexed="true"
stored="true" multiValued="true"/>
   <dynamicField name="*_b"  type="boolean" indexed="true" stored="true"/>
   <dynamicField name="*_bs" type="boolean" indexed="true" stored="true"
multiValued="true"/>
   <dynamicField name="*_f"  type="float"  indexed="true"  stored="true"/>
   <dynamicField name="*_fs" type="float"  indexed="true"  stored="true"
multiValued="true"/>
   <dynamicField name="*_d"  type="double" indexed="true"  stored="true"/>
   <dynamicField name="*_ds" type="double" indexed="true"  stored="true"
multiValued="true"/>
   <dynamicField name="*_coordinate"  type="tdouble" indexed="true"
stored="false" />
   <dynamicField name="*_dt"  type="date"    indexed="true"
stored="true"/>
   <dynamicField name="*_dts" type="date"    indexed="true"  stored="true"
multiValued="true"/>
   <dynamicField name="*_p"  type="location" indexed="true" stored="true"/>
   <dynamicField name="*_ti" type="tint"    indexed="true"  stored="true"/>
   <dynamicField name="*_tl" type="tlong"   indexed="true"  stored="true"/>
   <dynamicField name="*_tf" type="tfloat"  indexed="true"  stored="true"/>
   <dynamicField name="*_td" type="tdouble" indexed="true"  stored="true"/>
   <dynamicField name="*_tdt" type="tdate"  indexed="true"  stored="true"/>
   <dynamicField name="*_c"   type="currency" indexed="true"
stored="true"/>
   <dynamicField name="ignored_*" type="ignored" multiValued="true"/>
   <dynamicField name="attr_*" type="text_general" indexed="true"
stored="true" multiValued="true"/>
   <dynamicField name="random_*" type="random" />

    <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" />

    <fieldType name="string" class="solr.StrField"
sortMissingLast="true" />
    <fieldType name="boolean" class="solr.BoolField"
sortMissingLast="true"/>
    <fieldType name="int" class="solr.TrieIntField" precisionStep="0"
positionIncrementGap="0"/>
    <fieldType name="float" class="solr.TrieFloatField" precisionStep="0"
positionIncrementGap="0"/>
    <fieldType name="long" class="solr.TrieLongField" precisionStep="0"
positionIncrementGap="0"/>
    <fieldType name="double" class="solr.TrieDoubleField" precisionStep="0"
positionIncrementGap="0"/>
    <fieldType name="tint" class="solr.TrieIntField" precisionStep="8"
positionIncrementGap="0"/>
    <fieldType name="tfloat" class="solr.TrieFloatField" precisionStep="8"
positionIncrementGap="0"/>
    <fieldType name="tlong" class="solr.TrieLongField" precisionStep="8"
positionIncrementGap="0"/>
    <fieldType name="tdouble" class="solr.TrieDoubleField"
precisionStep="8" positionIncrementGap="0"/>
    <fieldType name="date" class="solr.TrieDateField" precisionStep="0"
positionIncrementGap="0"/>
    <fieldType name="tdate" class="solr.TrieDateField" precisionStep="6"
positionIncrementGap="0"/>
    <fieldType name="binary" class="solr.BinaryField"/>
    <fieldType name="random" class="solr.RandomSortField" indexed="true" />
    <fieldType name="text_ws" class="solr.TextField"
positionIncrementGap="100">
      <analyzer>
        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
      </analyzer>
    </fieldType>
    <fieldType name="text_general" class="solr.TextField"
positionIncrementGap="100">
      <analyzer type="index">
        <tokenizer class="solr.StandardTokenizerFactory"/>
        <filter class="solr.StopFilterFactory" ignoreCase="true"
words="stopwords.txt" />
        <filter class="solr.LowerCaseFilterFactory"/>
      </analyzer>
      <analyzer type="query">
        <tokenizer class="solr.StandardTokenizerFactory"/>
        <filter class="solr.StopFilterFactory" ignoreCase="true"
words="stopwords.txt" />
        <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt"
ignoreCase="true" expand="true"/>
        <filter class="solr.LowerCaseFilterFactory"/>
      </analyzer>
    </fieldType>
    <fieldType name="text_en" class="solr.TextField"
positionIncrementGap="100">
      <analyzer type="index">
        <tokenizer class="solr.StandardTokenizerFactory"/>
        <filter class="solr.StopFilterFactory"
                ignoreCase="true"
                words="lang/stopwords_en.txt"
                />
        <filter class="solr.LowerCaseFilterFactory"/>
	<filter class="solr.EnglishPossessiveFilterFactory"/>
        <filter class="solr.KeywordMarkerFilterFactory"
protected="protwords.txt"/>
        <filter class="solr.PorterStemFilterFactory"/>
      </analyzer>
      <analyzer type="query">
        <tokenizer class="solr.StandardTokenizerFactory"/>
        <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt"
ignoreCase="true" expand="true"/>
        <filter class="solr.StopFilterFactory"
                ignoreCase="true"
                words="lang/stopwords_en.txt"
                />
        <filter class="solr.LowerCaseFilterFactory"/>
	<filter class="solr.EnglishPossessiveFilterFactory"/>
        <filter class="solr.KeywordMarkerFilterFactory"
protected="protwords.txt"/>
        <filter class="solr.PorterStemFilterFactory"/>
      </analyzer>
    </fieldType>
    <fieldType name="text_en_splitting" class="solr.TextField"
positionIncrementGap="100" autoGeneratePhraseQueries="true">
      <analyzer type="index">
        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
        <filter class="solr.StopFilterFactory"
                ignoreCase="true"
                words="lang/stopwords_en.txt"
                />
        <filter class="solr.WordDelimiterFilterFactory"
generateWordParts="1" generateNumberParts="1" catenateWords="1"
catenateNumbers="1" catenateAll="0" splitOnCaseChange="1"/>
        <filter class="solr.LowerCaseFilterFactory"/>
        <filter class="solr.KeywordMarkerFilterFactory"
protected="protwords.txt"/>
        <filter class="solr.PorterStemFilterFactory"/>
      </analyzer>
      <analyzer type="query">
        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
        <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt"
ignoreCase="true" expand="true"/>
        <filter class="solr.StopFilterFactory"
                ignoreCase="true"
                words="lang/stopwords_en.txt"
                />
        <filter class="solr.WordDelimiterFilterFactory"
generateWordParts="1" generateNumberParts="1" catenateWords="0"
catenateNumbers="0" catenateAll="0" splitOnCaseChange="1"/>
        <filter class="solr.LowerCaseFilterFactory"/>
        <filter class="solr.KeywordMarkerFilterFactory"
protected="protwords.txt"/>
        <filter class="solr.PorterStemFilterFactory"/>
      </analyzer>
    </fieldType>
    <fieldType name="text_en_splitting_tight" class="solr.TextField"
positionIncrementGap="100" autoGeneratePhraseQueries="true">
      <analyzer>
        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
        <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt"
ignoreCase="true" expand="false"/>
        <filter class="solr.StopFilterFactory" ignoreCase="true"
words="lang/stopwords_en.txt"/>
        <filter class="solr.WordDelimiterFilterFactory"
generateWordParts="0" generateNumberParts="0" catenateWords="1"
catenateNumbers="1" catenateAll="0"/>
        <filter class="solr.LowerCaseFilterFactory"/>
        <filter class="solr.KeywordMarkerFilterFactory"
protected="protwords.txt"/>
        <filter class="solr.EnglishMinimalStemFilterFactory"/>
        <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
      </analyzer>
    </fieldType>
    <fieldType name="text_general_rev" class="solr.TextField"
positionIncrementGap="100">
      <analyzer type="index">
        <tokenizer class="solr.StandardTokenizerFactory"/>
        <filter class="solr.StopFilterFactory" ignoreCase="true"
words="stopwords.txt" />
        <filter class="solr.LowerCaseFilterFactory"/>
        <filter class="solr.ReversedWildcardFilterFactory"
withOriginal="true"
           maxPosAsterisk="3" maxPosQuestion="2"
maxFractionAsterisk="0.33"/>
      </analyzer>
      <analyzer type="query">
        <tokenizer class="solr.StandardTokenizerFactory"/>
        <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt"
ignoreCase="true" expand="true"/>
        <filter class="solr.StopFilterFactory" ignoreCase="true"
words="stopwords.txt" />
        <filter class="solr.LowerCaseFilterFactory"/>
      </analyzer>
    </fieldType>
    <fieldType name="alphaOnlySort" class="solr.TextField"
sortMissingLast="true" omitNorms="true">
      <analyzer>
        <tokenizer class="solr.KeywordTokenizerFactory"/>
        <filter class="solr.LowerCaseFilterFactory" />
        <filter class="solr.TrimFilterFactory" />
        <filter class="solr.PatternReplaceFilterFactory"
                pattern="([^a-z])" replacement="" replace="all"
        />
      </analyzer>
    </fieldType>
    <fieldType name="lowercase" class="solr.TextField"
positionIncrementGap="100">
      <analyzer>
        <tokenizer class="solr.KeywordTokenizerFactory"/>
        <filter class="solr.LowerCaseFilterFactory" />
      </analyzer>
    </fieldType>
    <fieldType name="ignored" stored="false" indexed="false"
multiValued="true" class="solr.StrField" />
    <fieldType name="point" class="solr.PointType" dimension="2"
subFieldSuffix="_d"/>

	<fieldType name="location" class="solr.LatLonType"
subFieldSuffix="_coordinate"/>

    <fieldType name="location_rpt"
class="solr.SpatialRecursivePrefixTreeFieldType"
        geo="false" distErrPct="0.025" maxDistErr="0.001"
distanceUnits="degrees" />

    <fieldType name="bbox" class="solr.BBoxField"
               geo="true" distanceUnits="kilometers"
numberType="_bbox_coord" />
    <fieldType name="_bbox_coord" class="solr.TrieDoubleField"
precisionStep="8" docValues="true" stored="false"/>

    <fieldType name="currency" class="solr.CurrencyField" precisionStep="8"
defaultCurrency="USD" currencyConfig="currency.xml" />
</schema>

Thanks!
Jennifer Coston



From:	Jennifer Coston <Je...@raytheon.com>
To:	solr-user@lucene.apache.org
Date:	08/11/2016 04:04 PM
Subject:	Need Help Resolving Unknown Shape Definition Error




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