The correct way to store coordinates in Solr

I paid a third-party coder for developing a circuit for Solr, but now that I have more understanding, I have questions.

The goal is to do a spatial search, so in my scheme I have the following:

<field name="latlng" type="location" indexed="true" stored="false" />
<field name="latlng_0_coordinate" type="double" indexed="true" stored="false" />
<field name="latlng_1_coordinate" type="double" indexed="true" stored="false" />

My site is sent via JSON to lat_lng_0_coordinate and latlng_1_coordinate, but nothing is passed to latlng.

Also, there is no other mention of "latlng" in my schema.xml, so it doesn't look like there is a union or union function there, as far as I can see.

So my question is, does latlng have a goal or does the code have an error?

+5
source share
1 answer

latlng . .

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

_coordinate.

latlng_1_coordinate latlng_0_coordinate.

, , latlng.

, 5 , . 41.431, 28.431 - , .

{!geofilt sfield=latlng}&pt=41.431,28.431&d=5

, .

. Solr: https://wiki.apache.org/solr/SpatialSearch#QuickStart

+5

All Articles