lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kyle Wilkinson (JIRA)" <>
Subject [jira] Commented: (SOLR-1568) Implement Spatial Filter
Date Sun, 09 May 2010 05:59:50 GMT


Kyle Wilkinson commented on SOLR-1568:

I was able to get this up and running with the latest patch, but I had to add a dynamicField
to my schema to get everything working: 
    <field name="latlon"                        type="latLon"    indexed="true"    stored="true"/>
    <dynamicField name="*_latLon"               type="tdouble"   indexed="true"     stored="false"/>

Is this expected?  If so, can you add it to the wiki to save the next person the trouble?
 Also, some feedback from trying to write boost and sort functions: The LatLon type is great
and it is very convenient that it handles calculating spherical distances (there's probably
a better term for this) for you.  However, I could not figure out how to take advantage of
writing my own boost function that uses this distance using the LatLon field.  Both the hsin
and dist functions require the the components of the point  / don't accept a LatLon (at least
as documented).  To use them, I ended up having to store separate fields in my document for
latitude and longitude, as well as a LatLon.  Also, it would be very convenient to not have
to pass in the radius of the earth into the hsin function.  There's a good chance with my
feedback that I'm just not doing something right or don't fully understand the capabilities
offered.  Overall this functionality is very useful and saved me a ton of time.  Thanks!

> Implement Spatial Filter
> ------------------------
>                 Key: SOLR-1568
>                 URL:
>             Project: Solr
>          Issue Type: New Feature
>            Reporter: Grant Ingersoll
>            Assignee: Grant Ingersoll
>            Priority: Minor
>             Fix For: 1.5
>         Attachments:, SOLR-1568.Mattmann.031010.patch.txt,
SOLR-1568.patch, SOLR-1568.patch, SOLR-1568.patch, SOLR-1568.patch, SOLR-1568.patch, SOLR-1568.patch,
SOLR-1568.patch, SOLR-1568.patch
> Given an index with spatial information (either as a geohash, SpatialTileField (see SOLR-1586)
or just two lat/lon pairs), we should be able to pass in a filter query that takes in the
field name, lat, lon and distance and produces an appropriate Filter (i.e. one that is aware
of the underlying field type for use by Solr. 
> The interface _could_ look like:
> {code}
> &fq={!sfilt dist=20}location:49.32,-79.0
> {code}
> or it could be:
> {code}
> &fq={!sfilt lat=49.32 lat=-79.0 f=location dist=20}
> {code}
> or:
> {code}
> &fq={!sfilt p=49.32,-79.0 f=location dist=20}
> {code}
> or:
> {code}
> &fq={!sfilt lat=49.32,-79.0 fl=lat,lon dist=20}
> {code}

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message