On Mon, Jun 11, 2001 at 11:19:31AM +0300, Mart?n Marqu?s wrote:
> I have a quite complex select query on postgres (obviously :-) ) using PHP
> (which is not the problem at the moment) which has some text searches using
> LIKE.
> My question is: "How can I write an ORDER BY statment so that it's ordered by
> the amount of matches it gets?"
> Is this posible without getting ichy with the programing?
<guess>
not likely. :) sounds like programming is gonna be
required.
you may be better off with some of the "contrib" features
including full-text-index (of which i have no working
knowledge). or a fancy pl/pgsql function. or a mod_perl glue
layer to coordinate your results...
</guess>
and using LIKE can be a serious performance drag if you use the
leading percent: "...LIKE '%this%'..." can't use any indexes
so it'll scan the whole database stem to stern. if you can stick
with "...LIKE 'this%'..." it'll at least be able to use the
indexes.
--
I figure: if a man's gonna gamble, may as well do it
without plowing. -- Bama Dillert, "Some Came Running"
will@serensoft.com
http://sourceforge.net/projects/newbiedoc -- we need your brain!
http://www.dontUthink.com/ -- your brain needs us!