Archive for the 'Launchpad' Category

Postgres FTI with SQLObject issue resolved

Friday, October 14th, 2005

Ah joy. Figured out that SQLObject can be extended fairly easily to handle the ranking problem I referred to previously.

The goal is to end up with a query like this:

SELECT Foo.id, Foo.name, Foo.title, rank(Foo.fti, ftq('browser')) AS rank
FROM Foo   WHERE Foo.fti @@ ftq('browser')
ORDER BY rank

So, hacking SQLObject to add a selectAlso= option to SQLObject.select gives us the ability to write code like this:

results = Foo.select("fti @@ ftq('browser')",
selectAlso="rank(fti, ftq('browser')) AS rank",
orderBy='-rank')

Voila. I’ll pass the SQLObject patch on to Stub for a review and submission upstream.

Postgres FTI and SQLObject

Thursday, October 13th, 2005

Postgres is a truly awesome database. When we started working on Launchpad I wasn’t sure if it would be up to the job. I was so wrong. It’s been robust, fast, and *professional* in every regard.

Stub has got full text search pretty smoothly integrated into Launchpad, using tsearch2. Today I setup the source package searching engine in the Soyuz part of Launchpad (see the page at http://launchpad.net/distros/ubuntu/+search) and used tsearch2. What I could not figure out, however, was how to rank the results by the quality of match.

We are using SQLObject. So the code ends up looking like this:

result = DistributionSourcePackageCache.select("fti @@ ftq(%s)" % sqlvalues(searchtext))

Now I have the resultset, but it does not seem to be in the optimally ranked order, and I can’t figure out how to get it that way. Does anyone know? Ah well, Stub will wake up shortly, will bother him then.

Launchpad hacking in Sau Carlos, Brazil

Friday, July 22nd, 2005

I’m in Sao Carlos, Brazil for a few weeks hacking on The Launchpad, and enjoying some of the local scenery. It struck me on yesterday’s early morning run (Kiko’s suggestion - I don’t generally like running) how lucky I am to be able to take a few weeks and work with this team, despite the intensity of everything else that’s going on at Canonical.

Normally I guess the Founder or CEO of a project would not have the luxury of diving into the heart of the technical challenges we face, and you could argue I should be focused on some of the more corporate activities a startup needs to deal with. But with the mix of non-profit and for-profit goals in Canonical and Ubuntu, I sort of feel it’s my great privilege to be able to participate in the hacking, too. There’s plenty of time to build value that will grow the project beyond what I can provide philanthropically - for the moment it’s all about creating interesting platforms for collaboration in the open source world. And that’s the part that I’m particularly interested in myself.

This week the focus has been Baz (the revision control system) as well as a web view of the distributed revision control world (all the branches people have publicly released) which we call “The Bazaar“. At the moment it’s pretty vestigial - it just shows some stats about the number of baz branches we know about that are related to upstream projects we care about. But in future it will let you see more details of each of those branches. The idea being that you can get a high-level view of all the hacking that is going on AROUND a project upstream, not just on the mainline branch. In a distributed revision control world, like the one the Linux kernel guys adopted initially with BK and now with Git, you might have lots of really interesting work going on outside of the mainline tree, so this web service will give you a view of all of that work. That should help create better collaboration between people interested in a particular feature.