My example query has d=1 as the first parameter, so none of the results should 
be coming back, but they are which makes it seem like it's not doing any 
geofiltering for some reason.

On 7/24/19, 2:06 AM, "Ere Maijala" <ere.maij...@helsinki.fi> wrote:

    I think you might be missing the d parameter in geofilt. I'm not sure if
    geofilt actually does anything useful without it.
    
    Regards,
    Ere
    
    Sanders, Marshall (CAI - Atlanta) kirjoitti 23.7.2019 klo 21.32:
    > We’re trying to index a polygon into solr and then filter/calculate 
geodist on the polygon (ideally we actually want a circle, but it looks like 
that’s not really supported officially by wkt/geojson and instead you have to 
switch format=”legacy” which seems like something that might be removed in the 
future so don’t want to rely on it).
    > 
    > Here’s the info from schema:
    > <field name="latlng" type="location_rpt" indexed="true" stored="true" 
multiValued="true"/>
    > 
    > <fieldType name="location_rpt" 
class="solr.SpatialRecursivePrefixTreeFieldType"
    >                    geo="true" distErrPct="0.025" maxDistErr="0.000009" 
distanceUnits="kilometers"
    >                     spatialContextFactory="Geo3D"/>
    > 
    > 
    > We’ve tried indexing some different data, but to keep it as simple as 
possible we started with a triangle (will eventually add more points to 
approximate a circle).  Here’s an example document that we’ve added just for 
testing:
    > 
    > {
    > "latlng": ["POLYGON((33.7942704 -84.4412613, 33.7100611 -84.4028091, 
33.7802888 -84.3279648, 33.7942704 -84.4412613))"],
    > "ID": "284598223"
    > }
    > 
    > 
    > However, it seems like filtering/distance calculations aren’t working (at 
least not the way we are used to doing it for points).  Here’s an example query 
where the pt is several hundred kilometers away from the polygon, yet the 
document still returns.  Also, it seems that regardless of origin point or 
polygon location the calculated geodist is always 20015.115
    > 
    > Example query:
    > 
select?d=1&fl=ID,latlng,geodist()&fq=%7B!geofilt%7D&indent=on&pt=33.9798087,-94.3286133&q=*:*&sfield=latlng&wt=json
    > 
    > Example documents coming back anyway:
    > "docs": [
    > {
    > "latlng": ["POLYGON((33.7942704 -84.4412613, 33.7100611 -84.4028091, 
33.7802888 -84.3279648, 33.7942704 -84.4412613))"],
    > "ID": "284598223",
    > "geodist()": 20015.115
    > },
    > {
    > "latlng": ["POLYGON((33.7942704 -84.4412613, 33.7100611 -84.4028091, 
33.7802888 -84.3279648, 33.7942704 -84.4412613))"],
    > "ID": "284600596",
    > "geodist()": 20015.115
    > }
    > ]
    > 
    > 
    > Anyone who has experience in this area can you point us in the right 
direction about what we’re doing incorrectly with either how we are indexing 
the data and/or how we are querying against the polygons.
    > 
    > Thank you,
    > 
    > 
    > --
    > Marshall Sanders
    > Principal Software Engineer
    > Autotrader.com
    > marshall.sande...@coxautoinc.com<mailto:marshall.sande...@coxautoinc.com>
    > 
    > 
    
    -- 
    Ere Maijala
    Kansalliskirjasto / The National Library of Finland
    

Reply via email to