At 13:34 -0400 10/9/07, Baron Schwartz wrote:
Looks like you've found the solution you need. The only other
suggestion I have is to use UNION ALL if you don't need to eliminate
duplicate rows in the UNION, because there's some overhead for
checking for them.
Hi Baron
Thanks for this, and I
I'm sure there must be an accepted technique for this, but it's
something I haven't tried before, so if anyone can point me in the
right direction I'd be grateful.
I'm writing a search facility for a site where the data is stored in
several tables - let's say 5 for this example - and I want
Chris Sansom wrote:
I'm sure there must be an accepted technique for this, but it's
something I haven't tried before, so if anyone can point me in the right
direction I'd be grateful.
I'm writing a search facility for a site where the data is stored in
several tables - let's say 5 for this
At 11:01 -0400 10/9/07, Baron Schwartz wrote:
I've built similar systems with a series of UNION queries. Each UNION has a
column for relevance, which can be a sum of CASE statements, such as
IF(name matches, 1, 0) + IF(text matches, 1, 0) AS relevance...
The entire UNION can then be ordered by
At 11:01 -0400 10/9/07, Baron Schwartz wrote:
The entire UNION can then be ordered by relevance. You could also
just add in an arbitrary number in each UNION, to get the effect of
ordering by where in the hierarchy the match is found.
Actually, your pointing me towards UNION may have done
Chris Sansom wrote:
At 11:01 -0400 10/9/07, Baron Schwartz wrote:
The entire UNION can then be ordered by relevance. You could also
just add in an arbitrary number in each UNION, to get the effect of
ordering by where in the hierarchy the match is found.
Actually, your pointing me towards