Archive for October, 2005

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.title, rank(Foo.fti, ftq('browser')) AS rank
FROM Foo   WHERE Foo.fti @@ ftq('browser')

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

results ="fti @@ ftq('browser')",
selectAlso="rank(fti, ftq('browser')) AS rank",

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

Breezy released!

Thursday, October 13th, 2005

Well done Matt, Colin, Fabio and company. This has been a very smooth release process, you’ve got it down to a fine art. There’s been lots of news coverage of the coolness of the Badger,so I won’t rehash that. Very well done indeed.

Personally, I’ve been hacking on some of the Launchpad infrastructure to support Dapper-On-Launchpad. The part of Launchpad that handles packages, archives, distro releases etc is called Soyuz, and while the back end of it is in good shape (thanks muchly Kinnison!) the web frontend is a bit weak. So I’ve finally got the skeleton of that to the point where we should be able to represent on the web what’s going on in the package archive itself. Of course there is but it misses some of the subtleties of version history, that we track in Launchpad and which it would be cool to display. Hopefully the new code will be live next week. As of next week, the Dapper archive will be open, all run by Launchpad. Expect delays, but they should be ironed out before UBZ.

So now we start the road to the Dapper Drake. I’ll spend this week focused on the definition of topics I’m hoping to cover at UBZ. As always we will track the specs in the Ubuntu wiki. This time we will have some help with scheduling and coordination, using the spec tracker in Launchpad itself to keep track of the status of each of the specs.

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 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 ="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.