What happened to my Lucene request?

I run Zend_Search_Lucene, which is almost exactly the same as normal Lucene. I store stores in my Lucene index and they keep this:

id of store for sql - 'store_id' of field type keyword

name of store - 'name' of field type text

latitude of store - 'lat' of field type keyword

longitude of store - 'lng' of field type keyword

      

I only have one store for testing in the database. It has the name "super amazing store", has an index of 11, lat 73.9 and lng 40.6. However, the results don't work as they should.

Here's an example of one of my requests that doesn't work:

(name: 'awesom *') AND lat: [- 74.486951 TO -73.486951] AND lng: [40.256054 to 41.256054]

The * is supposed to mean "and then whatever you want" and it will not return the store. If I call "awesome *" it returns correctly. I don't know how to get it to look for awesomatic / awesome / etc.

My other problem is that finding lat and lng doesn't work. They don't seem to matter, no matter what the lat or lng range is. Even if I put lat / lng porcelain as long as the name matches, it returns the result. I need it to only return a result if lat and lng are within their correct ranges.

What am I doing wrong?! Please, help!

+2


source to share


1 answer


Please see this question about Geosurvey at Lucene. I believe that indexing and looking up float values ​​won't work. Try to do these big zero filled integers. eg

lat:[-74486951 TO -73486951]



This can have a detrimental effect from a performance standpoint, so consider using a lower resolution or use some of the techniques from This question , which discusses indexing longitude and latitude data in Java Lucene (Zend Lucene is a bit lagging behind in versions, so try to use older files) ...

+2


source







All Articles