Here is an exemple of a spacial search, for instance searching all the result within 3km from a center point: SearchQuerySet().spacial(lat=49.4338870, long=1.0888390, radius=3, unit='km').order_by('-geo_distance')
Of course this patch is a quick and dirty fix for people who wants to run spacial queries with haystack. It works well for me, so may be it will for others.
> Here is an exemple of a spacial search, for instance searching all the > result within 3km from a center point: > SearchQuerySet().spacial(lat=49.4338870, long=1.0888390, radius=3, > unit='km').order_by('-geo_distance')
> Of course this patch is a quick and dirty fix for people who wants to > run spacial queries with haystack. It works well for me, so may be it > will for others.
- Firstly, i want to implement the changes for Solr 1.3+ . Since solr now has built in support for Geo stuff, i think that should be natively supported by haystack now. I'll send a pull request, after i've done that. Someone else(Samuel Joos) did send me some changes he did to make it work, which i'll try to commit to github.
As far as the JTeam SSP is concerned - Also, I don't think support for an extra plugin like belongs in the main repository.
- The current code base is haystack 1.1.1 i think, so need to merge in the latest master and test it out. - The plugin jar i used was 1.x, but JTeam seems to have upgraded it to 2.x so will have to see if there are backward compatible changes.
> - Firstly, i want to implement the changes for Solr 1.3+ . Since solr now
> has built in support for Geo stuff, i think that should be natively
> supported by haystack now.
> I'll send a pull request, after i've done that. Someone else(Samuel Joos)
> did send me some changes he did to make it work, which i'll try to commit to
> github.
> As far as the JTeam SSP is concerned
> - Also, I don't think support for an extra plugin like belongs in the main
> repository.
> - The current code base is haystack 1.1.1 i think, so need to merge in the
> latest master and test it out.
> - The plugin jar i used was 1.x, but JTeam seems to have upgraded it to 2.x
> so will have to see if there are backward compatible changes.
Can you link to the specific commit with your changes. I only see the Readme change on your repo. I didn't see any branches with spatial related commits. Maybe i'm missing something.
It's not working yet, but i was trying to use the solr built in LatLon field type. Will work when i'm free next(tricky!). Feel free to share your code. It'll be a great help seeing your implementation.
I've been thinking of merging my JTeam SSP + this solr34 work into the same branch. Maybe add a flag to settings.py to figure out what query syntax to use. They're pretty similar. Although SSP 2.x, differs from SSP 1.x, so i'd have to maintain 3 syntaxes slightly different in their own ways. But should be simple enough. Maybe in the future i can look at geohash etc. as well.