My goal is trying to retrieve all locations within a boundary using Solr
function IsWithin(Polygon()). I am using 2.1.1 and follow this
documentation from solr
https://wiki.apache.org/solr/SolrAdaptersForLuceneSpatial4.

First, I downloaded schema from Basho git hub
https://raw.githubusercontent.com/basho/yokozuna/develop/priv/default_schema.xml


Then I added new fieldtype to schema.xml

<fieldType name="location_rpt"
class="solr.SpatialRecursivePrefixTreeFieldType"
           
spatialContextFactory="com.spatial4j.core.context.jts.JtsSpatialContextFactory"
               distErrPct="0.025"
               maxDistErr="0.000009"
               units="degrees"
            />


I added new field to schema.xml

<dynamicField name="*_geotest"  type="location_rpt"  indexed="true"
stored="true"  multiValued="true" />

<field name="myloc"  type="location_rpt"  indexed="true" stored="true"
 multiValued="true" />


I uploaded to server

curl -i -XPUT http://localhost:8098/search/schema/_yz_default \
  -H 'content-type: application/xml' \
  --data-binary @schema.xml


I create new object

curl -i -H 'content-type: application/json' -X PUT
'http://localhost:8098/types/geo_type/buckets/stuff/keys/sf' -d
'{"name_tssd":"San Francisco",
"loc_geotest":"37.774929,-122.419416","myloc":"37.774929,-122.419416"}'


But Solr only indexes "name_tssd" and neither "loc_geotest" nor "myloc" is
indexed.

Please help!

PS: How do you remove custom schema.xml?
_______________________________________________
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com

Reply via email to