Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8682763
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T21:51:39+00:00 2026-06-12T21:51:39+00:00

I want to search a map within a bounding box whose lat/lng for North

  • 0

I want to search a map within a bounding box whose lat/lng for North East points and South West points are available. I have lat and lng indexed as TrieDoubleField type and latlng as solr.LatLonType type. The reason for searching within a box (and not a radius like in geofilt) is because the search is done on all areas visible on a rectangular map , and I am given the coordinates of 4 corners of the map.

Problem: Will it be inefficient to do 2 range queries, one for lat and one for lng? As shown in the image below, a lot of unnecessary ranges have to be searched through.

http://127.0.0.1:8080/solr/select?q=*:*fl=id&fq=lat:[42.2823890429 TO 42.4224427748] AND lng:[-71.3345718384 TO -70.7612228394]

If so, is there a better way?

fq={!bbox}&sfield=latlng&pt=45.15,-93.85&d=5 will not work as I cannot calculate the value for d to match the bounds of my map.

enter image description here

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T21:51:40+00:00Added an answer on June 12, 2026 at 9:51 pm

    Solr 4 has a set of new spatial field types in which you can specify the lat-lon bounding box. There is information here which I intend to bring up to date this weekend.

    If you are using Solr 3 then yes, you can just do numeric range queries as you are doing. If you want to handle a dateline cross then it’s a little more tricky as there are two pairs of range queries needed for the longitude. And “no”, this approach is not inefficient, as you asked. BTW you don’t need to index the latitude & longitude separately since the LatLonType does this already and you can use its fields. Look in the schema browser and you should see a field ending in __x and __y (if I recall).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an std::map and I want to search for a key using a
I'm building a search of sorts, which has various filters available. I want to
In my application i want to show Google map with search result in web
i want to put overlay like http://www.estately.com/CA/Cathedral_City#map this search in google map but I
I want to search places like google map in my app with using MKMapView.
I want to add a search bar in my activity. I have some lat
I want to search two item (name=string and location=json). this search is (one input
We want to search a file to find all instances of bar that are
I want to search through a html file and then get the url to
I want to search a series of files based on the files name. Here

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.