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 Vangelis Katsikaros <vk...@gmail.com> on 2016/04/14 12:56:19 UTC

dynamicField and type solr.LatLonType

Hi

I use solr [1] on ubuntu 14.04. I am trying to define a dynamicField on a custom 
type (ie nont built in like "int"). I don't see something mentioned in the 
documentation that prohibits it but I can't seem to make it work.

For a built in type, my code can index fine the following in schema.xml
<fields>
<dynamicField name="lala_*" type="int"   indexed="true" stored="false"/>
<fields>

but can't index with

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

<fields>
<dynamicField name="lala_*" type="tlala" indexed="true" stored="false"/>
</fields>

I get the following:
HTTP Status 400 - ERROR: [doc=123] Error adding field 'lala_1'='50.657398,-2.366020'

If you need any more info let me know.

Regards
Vangelis


[1]
Solr Specification Version: 3.5.0.2011.11.22.14.54.38
Solr Implementation Version: 3.5.0 1204988 - simon - 2011-11-22 14:54:38
Lucene Specification Version: 3.5.0
Lucene Implementation Version: 3.5.0 1204988 - simon - 2011-11-22 14:46:51

Re: dynamicField and type solr.LatLonType

Posted by Shawn Heisey <ap...@elyograg.org>.
On 4/14/2016 4:56 AM, Vangelis Katsikaros wrote:
> but can't index with
>
> <types>
> <fieldType name="tlala" class="solr.LatLonType"
> subFieldSuffix="_coordinate"/>
> </types>
>
> <fields>
> <dynamicField name="lala_*" type="tlala" indexed="true" stored="false"/>
> </fields>
>
> I get the following:
> HTTP Status 400 - ERROR: [doc=123] Error adding field
> 'lala_1'='50.657398,-2.366020'

When a LatLonType field is indexed, it will create two additional fields
containing the latitude and longitude as double-precision floating point
numbers.  These extra fields are normally handled by a dynamicField
definition for *_coordinate".  That dynamic field definition has a type
of tdouble.  It is indexed and not stored.  The "*_coordinate"
dynamicField and its associated fieldType can be found in Solr examples.

Adding that definition to your schema might fix this problem.  The full
stacktrace may mention a field name starting with lala_1 and ending with
_coordinate.  For further help, we will need to see that full
stacktrace, including any "Caused by" sections.

http://stackoverflow.com/a/12530639/2665648

> Solr Specification Version: 3.5.0.2011.11.22.14.54.38
> Solr Implementation Version: 3.5.0 1204988 - simon - 2011-11-22 14:54:38
> Lucene Specification Version: 3.5.0
> Lucene Implementation Version: 3.5.0 1204988 - simon - 2011-11-22
> 14:46:51

That's an ancient version of Solr -- over four years old now.  The 3.x
versions are VERY solid, but are receiving zero developer attention. 
I'm not telling you to upgrade, but if you find bugs, they have probably
already been fixed in a newer version, and will not be fixed in your
version.  I don't think the problem you're having is a bug.

Thanks,
Shawn