Solr: Missing Geographic Distance in Response When Using fl=_dist_:geodist()

A question that arised at the Freenode Solr IRC channel today was about _dist_:geodist() failing to include a field named _dist_ in the response – a field which would contain the return value from geodist(), which would be the distance from the source point to the destination document. The example from the wiki is:

&q=*:*&sfield=store&pt=45.15,-93.85&sort=geodist() asc&fl=_dist_:geodist()

The _dist_:geodist() in the fl= parameter adds a field named _dist_ with the returned contents from geodist() (the :-syntax creates a field name alias).

.. but why is it missing? Probably because using geodist() in the fl parameter is only supported on Solr 4.0 and later (which is currently only in trunk).

There’s a workaround on the wiki which you can use – but this will not allow you to score documents in any other way – the score returned will be the value of geodist() by using geodist() as the query:


Gadgetting Up The Bike

A good day for internet shopping! After spending some time riding my bike the last months, I’ve finally decided to purchase a proper cycle computer. After riding the regular track together with Anders today, he sent me the files from the run from his Garmin Edge 305. I’ve delayed this decision for a very long time, but when I saw that the files were pure XML and that the bundled training software actually weren’t that bad, I were sold.

So off we went to the internet to search for a Garmin Edge for a fair price here in Norway. Kartbutikken turned out to have the best prices, and they have the Garmin Edge 205 for a special price right now! I do however want support for heart rate monitoring and more importantly, the rate of pedaling (cadence). This meant upgrading to at least the Garmin Edge 305, but as it turned up to be hard to get it for a fair price, I rather went all the way and got the Garmin Edge 705! It’s a bad mother.. lover, and supports everything. Being a bit of a map nerd, I’m getting excited just thinking about mapping these beautiful paths on a map. Yeeehaaaw!

I’ll be sure to bring it along when I’m doing Grenserittet in just about two weeks time (~80 km).

Bonus points for using “gadgetting” for the first time.