From 8d477e62a32f8e8de21341aca7d3b01a5c2bf118 Mon Sep 17 00:00:00 2001 From: tim b Date: Wed, 22 Sep 2010 10:07:01 -0700 Subject: use image_urls table... should be slightly less brutal on the db --- src/site.clj | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/site.clj b/src/site.clj index bb4d2b8..4ff0c45 100644 --- a/src/site.clj +++ b/src/site.clj @@ -1002,12 +1002,10 @@ WHERE u.user_id = ANY(?)" (defn ghetto-search-query [num-tokens] (str "select - content from messages - where room_id = 1 - and content ilike " (str-join " and content ilike " (take num-tokens (repeat "?"))) " - and content like '%http://%' - order by message_id desc - limit 250;")) + url from image_urls + where content ilike " (str-join " and content ilike " (take num-tokens (repeat "?"))) " + order by last_posted desc + limit 200;")) (def *ghetto-search-regex* #"^[A-Za-z0-9\-_.+]*$") -- cgit v1.2.3-70-g09d2