solr 7.3.1 how to parse LatLonPointSpatialField in custom .jar
Hello, We are using solr with a home made jar with a custom function. function(0.1,1.0,43.8341851366,5.7818349,43.8342868634,5.7821059,latlng_pi) where latlng_pi is a document field of type location In solr 5.5.2, location was defined like this and parsed in the jar like this (with fq being an instance of org.apache.solr.search.FunctionQParser) value = fp.parseValueSource() In solr 7.3.1, we changed the definition to because solr.LatLonType is now deprecated. we now have an error "A ValueSource isn't directly available from this field. Instead try a query using the distance as the score." from org.apache.solr.schema.AbstractSpatialFieldType @Override public ValueSource getValueSource(SchemaField field, QParser parser) { //This is different from Solr 3 LatLonType's approach which uses the MultiValueSource concept to directly expose // the x & y pair of FieldCache value sources. throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, "A ValueSource isn't directly available from this field. Instead try a query using the distance as the score."); } To correct this error, we tried to see how the value was parsed in *GeoDistValueSourceParser, but it seems to us (we are not java programmers) very hacky and complicated and we would like to know if there is a simple solution to parse a *LatLonPointSpatialField in our jar. Thanks, Elisabeth
LatLonPointSpatialField
Hi all, I'm currently migrating a 4.9.0 solr standalone index to 7.2.1 cloud. In the schema, I've replaced the old LatLon type with the new LatLonPointSpatialField type as below In the 4.9.0 version, we could search based on a single point passed as an fq parameter ...&fq=doc_lat_lon:"37.77915239,-122.28593847"... However, that functionality does not seem to work for the new field type, and I get parsing errors: Is there still a way to search for a single point in syntax similar to the old version of solr? Or is the only option to use the geoFilt query parser with a distance of 0? Thanks, Chris
AW: LatLonPointSpatialField, sorting : sort param could not be parsed as a query, and is not a field that exists in the index
Sorry for "re-asking". Anybody else facing this issue (bug?), or can anybody provide an advice "where to look"? Thx Clemens -Ursprüngliche Nachricht- Von: Clemens Wyss DEV [mailto:clemens...@mysign.ch] Gesendet: Mittwoch, 1. November 2017 11:06 An: 'solr-user@lucene.apache.org' Betreff: LatLonPointSpatialField, sorting : sort param could not be parsed as a query, and is not a field that exists in the index Context: solr 6.6.0 Im switching my schemas from derprecated solr.LatLonType to solr.LatLonPointSpatialField. Now my sortquery (which used to work with solr.LatLonType): sort=geodist(b4_location__geo_si,47.36667,8.55) asc raises the error "sort param could not be parsed as a query, and is not a field that exists in the index: geodist(b4_location__geo_si,47.36667,8.55)" Invoking sort by sfield=b4_location__geo_si&pt=47.36667,8.55&sort=geodist() asc works as expected though... Why does "sort=geodict(fld,lat,ln)" no more work? Thx for any hints advices Clemens
LatLonPointSpatialField, sorting : sort param could not be parsed as a query, and is not a field that exists in the index
Context: solr 6.6.0 Im switching my schemas from derprecated solr.LatLonType to solr.LatLonPointSpatialField. Now my sortquery (which used to work with solr.LatLonType): sort=geodist(b4_location__geo_si,47.36667,8.55) asc raises the error "sort param could not be parsed as a query, and is not a field that exists in the index: geodist(b4_location__geo_si,47.36667,8.55)" Invoking sort by sfield=b4_location__geo_si&pt=47.36667,8.55&sort=geodist() asc works as expected though... Why does "sort=geodict(fld,lat,ln)" no more work? Thx for any hints advices Clemens