Hi,
Quote:
1. To get to the term of the fields that I want, do I have to iterate through all the terms like I am doing?
You can also work with TermDocs and seek(). Check out the
TermsFilter class. Using TermDocs you also get to the Document id and from there to the Document itself. Once you have the Document you can explicitly read the longitude and latitude values and calcualtes the distance. If the distance is in range you can just use the doc id to set the appropriate bit in the result.
If you have a look at the Lucene mailing lists you will find also other techniques to execute geospatial searches, eg the use of bounding boxes, etc.
Quote:
2. I'm not getting the negative sign in the longitude value when I call the termEnum.term().text() method. How can I get that also?
That's seems odd. Have you checked the index that it is indexed properly? You could use Luke to inspect the indexed values. Are you sure that you are not removing the '-' value in the bridge or somewhere along the analyzing process?
Quote:
3. If the distance is within the searched range, I get the TermDocs for both longitude and latitude for the right values and set to bitSet one by one. Is this the right way of doing it?
Not sure. Your code looks a little complicated. Once you calcualted the distance from one Document/Iventory to your user it should be just the question of calling result.set(docId).
--Hardy