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.