On Wed, 05 May 2010 06:00 -0700, "Grant Ingersoll" <gsing...@apache.org>
wrote:
> 
> On May 4, 2010, at 7:20 AM, pointbreak+s...@ml1.net wrote:
> 
> > I want to link documents to multiple spatial points, and filter
> > documents based on a bounding box. I was expecting that the
> > solr.PointType would help me with that, but run into a problem. When I
> > create a filter, it seems that Solr matches the latitude and longitude
> > of the PointType separately. Could somebody please advice me if this is
> > expected behavior, and if so how to handle this usecase.
> > 
> > My setup is as follows:
> > 
> > in schema.xml:
> >   <fieldType name="location" class="solr.PointType" dimension="2"
> >   subFieldSuffix="_d"/>
> >   <field name="location" type="location" indexed="true" stored="true"
> >   multiValued="true"/>
> > 
> > I create a document with the following locations:
> >   52.3672174, 4.9126891  and:
> >   52.3624717, 4.9106624
> > 
> > This document will match with the filter:
> >   location:[52.362,4.911 TO 52.363,4.913]
> > 
> > I would have expected it not to match, since both locations are outside
> > this bounding box (the longitude of the second, and the latitude of the
> > first point as point would be inside the bounding box).
> 
> Yes, it stores those points as separate fields internally.   You should
> be able to see this by adding &debugQuery=true.
> 
> You probably will need to have a separate field for the second point, or
> use a filter query that respects the position of the token (which doesn't
> exist and would need to be implemented)

Thank you. Yes I see that is what it does. But I thought that the idea
of the "Poly Fields" in Spatial Solr was to overcome this problem and be
able to treat each PointType field as one field, instead of a separate
latitude and longitude. I can't figure out though from the information
in the JIRA-issues about this subject how to use this, which patches I
would need, etc.

WRT implementing a filter query like you suggest: I see there are many
questions about this on this mailing lists, but no real answers, which
lets me believe this is in fact not so simple. Any pointers of how to go
that route?

Reply via email to