Ok, definitely I won't need that spatialContextFactory: Solr supports polygons via JTS Topology Suite, which does not come with Solr. It's a JAR file that you need to put on Solr's classpath (but not via the standard solrconfig.xml mechanisms). If you intend to use those shapes, set this attribute to org.locationtech.spatial4j.context.jts.JtsSpatialContextFactory. (note: prior to Solr 6, the "org.locationtech.spatial4j" part was "com.spatial4j.core").
So I believe I can go on with your snippet. Thanks! Alex On Mon, May 9, 2016 at 9:26 PM, Alex De la rosa <alex.rosa....@gmail.com> wrote: > Thank Jorge, > > I was reading the documentation of Solr and seems they changed the > spatialContextFactory in their latest version: > > > https://cwiki.apache.org/confluence/display/solr/Spatial+Search#SpatialSearch-SpatialRecursivePrefixTreeFieldType(abbreviatedasRPT) > > This should work according to new documentation: > > <fieldType name="location_rpt" > class="solr.SpatialRecursivePrefixTreeFieldType" > spatialContextFactory="org.locationtech.spatial4j.context.jts.JtsSpatialContextFactory" > distErrPct="0.025" maxDistErr="0.000009" units="degrees" /> > > Although maybe is not needed to add the spatialContentFactory as per your > example... > > Thanks, > Alex > > On Mon, May 9, 2016 at 9:23 PM, Jorge Garrido gomez < > jorge.garr...@hovanetworks.com> wrote: > >> Hello Alex, >> >> We solved the issue using the Spatial: >> >> <fieldType name="location_rpt" >> class="solr.SpatialRecursivePrefixTreeFieldType" >> distErrPct="0.025" >> maxDistErr="0.000009" >> units="degrees" >> /> >> >> We use that definition for the field and works perfectly, I hope this can be >> helpful, if you want more info maybe we can help you >> >> >> Thank you! :-) >> >> >> >> On May 9, 2016, at 12:06 PM, Alex De la rosa <alex.rosa....@gmail.com> >> wrote: >> >> Ok, i solved the issues for the datatypes "int", "string", but still >> getting errors for the "location_rpt": >> >> <fieldType name="location_rpt" >> class="solr.SpatialRecursivePrefixTreeFieldType" >> spatialContextFactory="com.spatial4j.core.context.jts.JtsSpatialContextFactory" >> distErrPct="0.025" maxDistErr="0.000009" units="degrees" /> >> >> 2016-05-09 19:03:56.798 [error] <0.588.0>@yz_index:core_create:287 >> Couldn't create index leaders_b: >> {ok,"500",[{"Content-Type","text/html;charset=ISO-8859-1"},{"Cache-Control","must-revalidate,no-cache,no-store"},{"Content-Length","11214"}],<<"<html>\n<head>\n<meta >> http-equiv=\"Content-Type\" content=\"text/html; >> charset=ISO-8859-1\"/>\n<title>Error 500 >> {msg=com/vividsolutions/jts/geom/CoordinateSequenceFactory,trace=java.lang.NoClassDefFoundError: >> com/vividsolutions/jts/geom/CoordinateSequenceFactory\n\tat >> java.lang.Class.getDeclaredConstructors0(Native Method)\n\tat >> java.lang.Class.privateGetDeclaredConstructors(Class.java:2595)\n\tat >> java.lang.Class.getConstructor0(Class.java:2895)\n\tat >> java.lang.Class.newInstance(Class.java:354)\n\tat >> com.spatial4j.core.context.SpatialContextFactory.makeSpatialContext(SpatialContextFactory.java:96)\n\tat >> org.apache.solr.schema.AbstractSpatialFieldType.init(AbstractSpatialFieldType.java:107)\n\tat >> org.apache.solr.schema.AbstractSpatialPrefixTreeFieldType.init(AbstractSpatialPrefixTreeFieldType.java:43)\n\tat >> org.apache.solr.schema.SpatialRecursivePrefixTreeFieldType.init(SpatialRecursivePrefixTreeFieldType.java:37)\n\tat >> org.apache.solr.schema.FieldType.setArgs(FieldType.java:165)\n\tat >> org.apache.solr.schema.FieldTypePluginLoader.init(FieldTypePluginLoader.java:141)\n\tat >> org.apache.solr.schema.FieldTypePluginLoader.init(FieldTypePluginLoader.java:43)\n\tat >> org.apache.solr.util.plugin.AbstractPluginLoader.load(AbstractPluginLoader.java:190)\n\tat >> org.apache.solr.schema.IndexSchema.readSchema(IndexSchema.java:468)\n\tat >> org.apache.solr.schema.IndexSchema.<init>(IndexSchema.java:166)\n\tat >> org.apache.solr.schema.IndexSchemaFactory.create(IndexSchemaFactory.java:55)\n\tat >> org.apache.solr.schema.IndexSchemaFactory.buildIndexSchema(IndexSchemaFactory.java:69)\n\tat >> org.apache.solr.core.CoreContainer.createFromLocal(CoreContainer.java:559)\n\tat >> org.apache.solr.core.CoreContainer.create(CoreContainer.java:597)\n\tat >> org.apache.solr.handler.admin.CoreAdminHandler.handleCreateAction(CoreAdminHandler.java:509)\n\tat >> org.apache.solr.handler.admin.CoreAdminHandler.handleRequestBody(CoreAdminHandler.java:152)\n\tat >> org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:135)\n\tat >> org.apache.solr.servlet.SolrDispatchFilter.handleAdminRequest(SolrDispatchFilter.java:732)\n\tat >> org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:268)\n\tat >> org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:217)\n\tat >> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1419)\n\tat >> org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:455)\n\tat >> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)\n\tat >> org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:557)\n\tat >> org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)\n\tat >> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1075)\n\tat >> org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:384)\n\tat >> org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)\n\tat >> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1009)\n\tat >> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)\n\tat >> org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:255)\n\tat >> org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:154)\n\tat >> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)\n\tat >> org.eclipse.jetty.server.Server.handle(Server.java:368)\n\tat >> org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:489)\n\tat >> org.eclipse.jetty.server.BlockingHttpConnection.handleRequest(BlockingHttpConnection.java:53)\n\tat >> org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:942)\n\tat >> org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:1004)\n\tat >> org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.ja...">>} >> Anyone knows how to fix it? >> >> Thanks, >> Alex >> >> On Mon, May 9, 2016 at 8:50 PM, Alex De la rosa <alex.rosa....@gmail.com> >> wrote: >> >>> i see... that part of the schema was written in another code block in >>> the documentation: >>> >>> <fieldType name="int" class="solr.TrieIntField" precisionStep="0" >>> positionIncrementGap="0"/> >>> >>> will try with that :) thanks >>> >>> Alex >>> >>> On Mon, May 9, 2016 at 8:48 PM, Vitaly <13vitam...@gmail.com> wrote: >>> >>>> You don't have this type under <types>. The failure is about "int" >>>> because it's the first one encountered in the list of fields. >>>> >>>> Regards, >>>> Vitaly >>>> >>>> On Mon, May 9, 2016 at 7:16 PM, Alex De la rosa < >>>> alex.rosa....@gmail.com> wrote: >>>> >>>>> Hi there, >>>>> >>>>> I'm trying to create a custom index as seen at >>>>> http://docs.basho.com/riak/kv/2.1.4/developing/usage/search-schemas >>>>> and I'm getting the following errors in my log: >>>>> >>>>> 2016-05-09 18:08:05.229 [error] <0.588.0>@yz_index:core_create:287 >>>>> Couldn't create index scores: {ok,"400",[{"Content-Type","application/xml; >>>>> charset=UTF-8"},{"Transfer-Encoding","chunked"}],<<"<?xml version=\"1.0\" >>>>> encoding=\"UTF-8\"?>\n<response>\n<lst name=\"responseHeader\"><int >>>>> name=\"status\">400</int><int name=\"QTime\">26</int></lst><lst >>>>> name=\"error\"><str name=\"msg\">Error CREATEing SolrCore 'scores': >>>>> *Unable >>>>> to create core: scores Caused by: Unknown fieldType 'int' specified on >>>>> field points*</str><int >>>>> name=\"code\">400</int></lst>\n</response>\n">>} >>>>> >>>>> 2016-05-09 18:08:43.096 [error] <0.9673.1>@yz_index:sync_index:464 >>>>> Solr core error after trying to create index scores: >>>>> <<"org.apache.solr.common.SolrException:org.apache.solr.common.SolrException: >>>>> *Unknown fieldType 'int' specified on field points*. Schema file is >>>>> /var/lib/riak/yz/scores/./leaders.xml">> >>>>> >>>>> is saying the type "int" is unknown!! any ideas why? this is the >>>>> schema i'm uploading: >>>>> >>>>> <?xml version="1.0" encoding="UTF-8" ?> >>>>> <schema name="leaders" version="1.5"> >>>>> <fields> >>>>> <dynamicField name="*" type="ignored" /> >>>>> <field name="points" type="int" indexed="true" >>>>> stored="false"/> >>>>> <field name="firstname" type="string" indexed="true" >>>>> stored="true"/> >>>>> <field name="lastname" type="string" indexed="true" >>>>> stored="true"/> >>>>> <field name="location" type="location_rpt" indexed="true" >>>>> stored="true"/> >>>>> <field name="_yz_id" type="_yz_str" indexed="true" >>>>> stored="true" multiValued="false" required="true"/> >>>>> <field name="_yz_ed" type="_yz_str" indexed="true" >>>>> stored="false" multiValued="false"/> >>>>> <field name="_yz_pn" type="_yz_str" indexed="true" >>>>> stored="false" multiValued="false"/> >>>>> <field name="_yz_fpn" type="_yz_str" indexed="true" >>>>> stored="false" multiValued="false"/> >>>>> <field name="_yz_vtag" type="_yz_str" indexed="true" >>>>> stored="false" multiValued="false"/> >>>>> <field name="_yz_rk" type="_yz_str" indexed="true" >>>>> stored="true" multiValued="false"/> >>>>> <field name="_yz_rt" type="_yz_str" indexed="true" >>>>> stored="true" multiValued="false"/> >>>>> <field name="_yz_rb" type="_yz_str" indexed="true" >>>>> stored="true" multiValued="false"/> >>>>> <field name="_yz_err" type="_yz_str" indexed="true" >>>>> stored="false" multiValued="false"/> >>>>> </fields> >>>>> >>>>> <uniqueKey>_yz_id</uniqueKey> >>>>> >>>>> <types> >>>>> <fieldType name="location_rpt" >>>>> class="solr.SpatialRecursivePrefixTreeFieldType" >>>>> spatialContextFactory="com.spatial4j.core.context.jts.JtsSpatialContextFactory" >>>>> distErrPct="0.025" maxDistErr="0.000009" units="degrees" /> >>>>> <fieldtype name="ignored" stored="false" indexed="false" >>>>> multiValued="true" class="solr.StrField" /> >>>>> <!-- YZ String: Used for non-analyzed fields --> >>>>> <fieldType name="_yz_str" class="solr.StrField" >>>>> sortMissingLast="true" /> >>>>> </types> >>>>> </schema> >>>>> >>>>> Thanks, >>>>> Alex >>>>> >>>>> _______________________________________________ >>>>> riak-users mailing list >>>>> riak-users@lists.basho.com >>>>> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com >>>>> >>>>> >>>> >>> >> _______________________________________________ >> riak-users mailing list >> riak-users@lists.basho.com >> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com >> >> >> >
_______________________________________________ riak-users mailing list riak-users@lists.basho.com http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com