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 Simon Wistow <si...@thegestalt.org> on 2010/09/01 02:05:47 UTC

Problems indexing spatial field - undefined subField

I'm trying to index a latLon field.

I have a fieldType in my schema.xml that looks like

<fieldType name="latLon" class="solr.LatLonType" subFieldSuffix="_latLon"/>

and a field that looks like

<field name="location" type="latLon"  indexed="true"  stored="true"/>

I'm trying upload via the JSON update handler but I'm getting a 400 
error

undefined field location_0_latLon

FWIW the JSON looks like

  "location": "38.044337,-103.513824"

Any idea what I'm doing wrong. Maybe I shouldn't be using the JSON 
update handler?

Simon



Re: Problems indexing spatial field - undefined subField

Posted by Thomas Joiner <th...@gmail.com>.
While you have already solved your problem, my guess as to why it didn't
work originally is that you probably didn't have a
<dynamicField name="*_latLon" indexed="true" stored="true" />

What subFieldType does is it registers a dynamicField for you.
 subFieldSuffix requires that you have already defined that dynamicField.

On Tue, Aug 31, 2010 at 8:07 PM, Simon Wistow <si...@thegestalt.org> wrote:

> On Wed, Sep 01, 2010 at 01:05:47AM +0100, me said:
> > I'm trying to index a latLon field.
> >
> > <fieldType name="latLon" class="solr.LatLonType"
> subFieldSuffix="_latLon"/>
> > <field name="location" type="latLon"  indexed="true"  stored="true"/>
>
> Turns out changing it to
>
> <fieldType name="latLon" class="solr.LatLonType" subFieldType="double"/>
>
> fixed it.
>
>
>

Re: Problems indexing spatial field - undefined subField

Posted by Simon Wistow <si...@thegestalt.org>.
On Wed, Sep 01, 2010 at 01:05:47AM +0100, me said:
> I'm trying to index a latLon field.
>
> <fieldType name="latLon" class="solr.LatLonType" subFieldSuffix="_latLon"/>
> <field name="location" type="latLon"  indexed="true"  stored="true"/>

Turns out changing it to 

<fieldType name="latLon" class="solr.LatLonType" subFieldType="double"/>

fixed it.