Reputation: 554
I am trying to index a geo json to SOLR index , after all required setting was set in schema :
fieldType name="location_rpt" class="solr.SpatialRecursivePrefixTreeFieldType"
<spatialContextFactory="com.spatial4j.core.context.jts.JtsSpatialContextFactory"
distErrPct="0.025"
maxDistErr="0.000009"
distanceUnits="degrees"/>
all JTS libs were added as required .
there is a lack of documentation on this subject in solr ref guide . the only info is there , but is it not clear how to manage it :
https://lucene.apache.org/solr/guide/7_4/spatial-search.html#indexing-geojson-and-wkt
I am trying to understand how does POST request should looks like ?
because GEOJSON is hierarchy json i could not to put it as a field value for _rpt
any help will be appreciated, I need a simple sample of POST request .
Upvotes: 0
Views: 1055
Reputation: 564
The location_rpt field will only index your Geometry data. You can index the entire GeoJSON with the field containing the geometry data named as location_rpt. Here is a sample Geometry data indexed in SOLR:
{
"type":"1",
"id":"131",
"FenceCode":"Location2",
"fence":["POLYGON Z ((73.7086164951324 18.5958565315978 0,73.7085199356079 18.5959073750869 0,73.7064063549042 18.5994867185663 0,73.7081658840179 18.5997002565659 0,73.7093031406402 18.5995884033614 0,73.7103760242462 18.5992935172882 0,73.7114810943603 18.5986834065498 0,73.712146282196 18.5981241364523 0,73.7126290798187 18.5975750331149 0,73.7128221988678 18.5972394690926 0,73.7107515335083 18.5965276644318 0,73.7088739871979 18.5959175437829 0,73.7086164951324 18.5958565315978 0))"],
"name":"Location2",
"_version_":1607394069145714688 }
I had created a separate field called fence of type solr.SpatialRecursivePrefixTreeFieldType instead of naming it location_rpt, just for logical naming sake.
Upvotes: 1