lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lance Java <>
Subject Re: Spatial Search
Date Sun, 01 Jan 2012 11:18:18 GMT
Hi, I'm trying to keep this a lucene only project rather than bring in solr
which, as I understand, needs to run in a separate web container. I'd like
to use a single webapp for my project as I'm unsure of the implications of
hosting such a project on the cloud.

I downloaded lucene-spatial-playground and had a poke through the code and
found that TwoDoublesStrategyTestCase runs the following query:

   [San Francisco] G5391959 @ IsWithin(-122.524918 37.674973 -122.360123

This seemed close to what I wanted except that it uses a bounding box
instead of a circle. Taking inspiration from
BaseSpatialContextTestCase.checkBasicShapeIO() I tried the following

   [San Francisco] G5391959 @ IsWithin(*Circle*( -122.524918 37.674973

But unfortunately I got the following exception:

   InvalidShapeException: A rectangle is the only supported at this time,
not class org.apache.lucene.spatial.base.shape.simple.CircleImpl

So it seems that isWithin a circle is not currently supported. If anyone
has any information/documentation on the lucene-spatial-playground it would
be helpful.

In the mean time I have taken inspiration from
come up with a working solution.

20 tube stations are 1 miles from liverpool st
47 tube stations are 2 miles from liverpool st
92 tube stations are 3 miles from liverpool st
138 tube stations are 4 miles from liverpool st

But I'm a bit worried about this solution since Yonik has pointed out that
the tier based approach is broken. Yonik, any more info on why this is
broken? Perhaps a bounding box that works is better than a circle that
doesn't ;)


On 31 December 2011 18:07, Yonik Seeley <> wrote:

> On Sat, Dec 31, 2011 at 11:52 AM, Lance Java <>
> wrote:
> > Hi, I am new to Lucene and I am trying to use spatial search.
> The old tier-based stuff in Lucene is broken and considered deprecated.
> For Lucene, this may currently be your best hope:
> Solr has also had built-in spatial for a little while too:
> -Yonik
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message