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 Cam Bazz <ca...@gmail.com> on 2011/11/08 23:38:49 UTC

representing latlontype in pojo

Hello,

I have custom pojo's, and I use solrj to read and index them with
getBeans() method.

So now, I want to store a spatially searchable data member in my pojo.


I have in my schema.xml:

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

and


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

-

so, what object type must I have in my bean? LatLonType does not seem
to have a constructor, or getX, getY methods, and I think it is
internal to solr.

How can I store a 2d point and index it to a field type that is
latlontype, if I am using solrj?

Best Regards,
C.B.

Re: representing latlontype in pojo

Posted by Michael Kuhlmann <ku...@solarier.de>.
Am 08.11.2011 23:38, schrieb Cam Bazz:
> How can I store a 2d point and index it to a field type that is
> latlontype, if I am using solrj?

Simply use a String field. The format is "$latitude,$longitude".

-Kuli