lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jennifer Coston <Jennifer.Cos...@raytheon.com>
Subject Re: Need Help Resolving Unknown Shape Definition Error
Date Fri, 12 Aug 2016 16:51:41 GMT

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


Mime
  • Unnamed multipart/related (inline, None, 0 bytes)
View raw message