valeriansaliou / sonic

🦔 Fast, lightweight & schema-less search backend. An alternative to Elasticsearch that runs on a few MBs of RAM.
https://crates.io/crates/sonic-server
Mozilla Public License 2.0
19.87k stars 567 forks source link

Geographical search (or text search query filter?) #190

Open natew opened 4 years ago

natew commented 4 years ago

Just curious if supported or planned to be?

valeriansaliou commented 4 years ago

That's not planned. But I'm curious what's your use-case it?

natew commented 4 years ago

We have an app for searching food in your area, so this would power that search alongside various faceting and sorting.

I don't know the best geo query, but for now I think a simple lat/long + radius would work for us.

valeriansaliou commented 4 years ago

Got that. Did you know you could already do this w/ Redis: https://redislabs.com/redis-best-practices/indexing-patterns/geospatial/ ?

We use that at Crisp to generate an "heatmap" of where your website visitors are in the world, simple & fast & never had an issue w/ it.

valeriansaliou commented 4 years ago

Or, probably you'd like to do some restrictions on Sonic text search results using geo area boundaries. That could be probably coupled w/ a Redis or something else.

natew commented 4 years ago

Yea the search itself needs to be limited to a geo range. I'd bet there's some way to do it outside Sonic, but the competition has it (Manticore, Bleve, Elastic, Solr). That said, Sonic looks really nice!

valeriansaliou commented 4 years ago

Thanks! Leaving this open. Might be a good idea to have it indeed.

iandees commented 1 year ago

I was playing with Sonic and experimented with indexing some point features using different levels of quadkey values per identifier. This works quite well, with the exception that I can't figure out how to disable also searching for typos. In other words, if I search for "011210" but only have an item indexed with "011110", the typo system will include it in the results (because it's off by one character).

If we could optionally turn off typos for some keys (maybe with double-quotes or something), it would be possible to do basic geographic biasing with Sonic.