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 7070491
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:34:22+00:00 2026-05-28T05:34:22+00:00

The title is not clear so let me explain: In my apps, I have

  • 0

The title is not clear so let me explain:

In my apps, I have events. They are geolocated: I store the latitude and longitude.
My problem is that, when users search for events, they type things like: kansas, montreal etc.
So when I locate kansas (using geocoder), I get its “center”, and so when I ask sunspot for the events “near” this location, I only get the ones close to the center of the location. It’s even worse if they type france or australia.

I was wondering if you knew about a good way to handle that.

My only idea right now is to also store the country, state etc of the location of the event when it’s saved (I can get the normalized address from google), and then do a text search of what they entered in the location field…

But there is problem about that approach 🙁
In solr, it’s impossible to do the following:

any_of do
    with(:coordinates).near(coord[0], coord[1], :precision => 3)
    keywords where
end

because near can’t be nested. See here.

Did they make changes in sunspot 1.3 to allow that?

Do you see any other solution? I might even accept changing from solr to another search platform like elastic search but I would prefer not to.

  • 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-05-28T05:34:23+00:00Added an answer on May 28, 2026 at 5:34 am

    I switched to ElasticSearch, and I absolutely love it. It’s so much better for geolocation search… I still have some problems with facets, but overall I would recommend ES over sunspot for someone starting a new app.

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

Sidebar

Related Questions

Ok Title may not be clear so let me explain. I have 2 classes,
The title is not very clear, so I'll try to explain better. I have
maybe the title is not very clear, let me elaborate. I have a python
The question title is not very clear so let me explain. I am trying
The title might not explain my problem fully but I wasn't sure how to
I know the title is not very clear but here is the problem. I
The title is probably not very clear. I have the following example in mind:
I don't know if the title is clear enough or not, but let me
Let's say I have a mini app that consists of title, thumb, lg_image, url
The question title is a bit obscure so let me explain. A requirement that

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.