lucene.net - SpatialQuery for location based search using Lucene -


My Lucene index has been indexed in areas of latitude and latitude:

  doc .Add (new area ("latitude", latitude.Toastring (), field.store.Yes, field.inindex.IN_TOKENIZED); Doc.Add (new field ("longitude", longitude.Toastring (), field.store.Yes, field.inindex.IN_TOKENIZED);  

I want to retrieve a group of documents from this index, whose length and long value are in some bounds.

As you already know, the wave may be longer and the negative value How do I correctly store decimal numbers I signed in Lusen? Do the following points give the right results or is there any other way to do this?

  Term low latitude = new period ("latitude", border.South.ToString ()); Upper Statement of Period = New Period ("Latitude", Border Answer: Toastring ()); Reconnectivity Overview * New Rangesize (lower latitude, top, true); Address space location Add (LatitudeRange, Booleanclose.Okshur.Soul); Term longlength = new term ("longitude", border west.tostring); Upper lengeness of the period = new word ("longitude", borders .Eust.Tostring ()); Renjcontentgroundrangequeryque = new rangequita (lower sexuality, upper amounts, true); Find location location. Add (graphing range technology, boolean cloth oakur. HOLD); Besides, I wanted to know that Lange's ConstantScoreRangeQuery is better than the RangeQuery class. 

There is another problem in this context: I have a document index with the following 3 cities:

  • Lions, IL

    Oak Brook, IL

    San Francisco, CA

If I give input as "Leonus, IL" then this The record comes up. But if I give San Francisco, CA as input, it does not happen.

However, if I keep cities for this document as follows:

  • San Oak Brown, IL

    And when I I give Francisco, CA as input, so this record shows in the search results.

What do I want here if I type any of the three cities in input, then I should get this document in the search results.

Please help get it.

Thank you.

After Schoffman's suggestion, you can use the same used by all popular map apps Choose the zoom level that is adequate for your needs and do not forget the pad with the leading zero.

In relation to this, it is slower than Constantascoreanage and limits the range of values.

The problem of city-state, we can only guess. But the first thing to check is that you are expecting them to meet these indexed words and parsed queries.


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -