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)

HTH,
Grant

Reply via email to