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 Yonik Seeley <yo...@lucidimagination.com> on 2011/04/28 14:44:30 UTC

Re: Spatial Search

On Thu, Apr 28, 2011 at 5:15 AM, Jonas Lanzendörfer
<jo...@affinitas.de> wrote:
> I am new to solr and try to use the spatial search feature which was added in 3.1. In my schema.xml I have 2 double fields for latitude and longitude. How can I get them into the location field type? I use solrj to fill the index with data. If I would use a location field instead of two double fields, how could I fill this with solrj? I use annotations to link the data from my dto´s to the index fields...


I've not used the annotation stuff in SolrJ, but since the value sent
in must be of the for 10.3,20.4 then
I guess one would have to have a String field with this value on your object.


-Yonik
http://www.lucenerevolution.org -- Lucene/Solr User Conference, May
25-26, San Francisco

Re: Spatial Search

Posted by Jonas Lanzendörfer <jo...@affinitas.de>.
I did the String Solution, works great, thank you!

Am 29.04.2011 um 00:25 schrieb Jan Høydahl:

> 1) Create an extra String field on your bean as Yonik suggests or
> 2) Write an UpdateRequestHandler which reads the doubles and creates the LatLon from that
> 
> --
> Jan Høydahl, search solution architect
> Cominvent AS - www.cominvent.com
> 
> On 28. apr. 2011, at 14.44, Yonik Seeley wrote:
> 
>> On Thu, Apr 28, 2011 at 5:15 AM, Jonas Lanzendörfer
>> <jo...@affinitas.de> wrote:
>>> I am new to solr and try to use the spatial search feature which was added in 3.1. In my schema.xml I have 2 double fields for latitude and longitude. How can I get them into the location field type? I use solrj to fill the index with data. If I would use a location field instead of two double fields, how could I fill this with solrj? I use annotations to link the data from my dto´s to the index fields...
>> 
>> 
>> I've not used the annotation stuff in SolrJ, but since the value sent
>> in must be of the for 10.3,20.4 then
>> I guess one would have to have a String field with this value on your object.
>> 
>> 
>> -Yonik
>> http://www.lucenerevolution.org -- Lucene/Solr User Conference, May
>> 25-26, San Francisco
> 


Re: Spatial Search

Posted by Jan Høydahl <ja...@cominvent.com>.
1) Create an extra String field on your bean as Yonik suggests or
2) Write an UpdateRequestHandler which reads the doubles and creates the LatLon from that

--
Jan Høydahl, search solution architect
Cominvent AS - www.cominvent.com

On 28. apr. 2011, at 14.44, Yonik Seeley wrote:

> On Thu, Apr 28, 2011 at 5:15 AM, Jonas Lanzendörfer
> <jo...@affinitas.de> wrote:
>> I am new to solr and try to use the spatial search feature which was added in 3.1. In my schema.xml I have 2 double fields for latitude and longitude. How can I get them into the location field type? I use solrj to fill the index with data. If I would use a location field instead of two double fields, how could I fill this with solrj? I use annotations to link the data from my dto´s to the index fields...
> 
> 
> I've not used the annotation stuff in SolrJ, but since the value sent
> in must be of the for 10.3,20.4 then
> I guess one would have to have a String field with this value on your object.
> 
> 
> -Yonik
> http://www.lucenerevolution.org -- Lucene/Solr User Conference, May
> 25-26, San Francisco