diff options
| author | tim b <timb@camcompu.home> | 2010-09-22 10:07:01 -0700 |
|---|---|---|
| committer | tim b <timb@camcompu.home> | 2010-09-22 10:07:01 -0700 |
| commit | 8d477e62a32f8e8de21341aca7d3b01a5c2bf118 (patch) | |
| tree | 8b4fbb416372cf14154823b86f90763a7b06e14f /src/site.clj | |
| parent | 8033ab41346987d835d20377dc9d13d4f50e392e (diff) | |
use image_urls table... should be slightly less brutal on the db
Diffstat (limited to 'src/site.clj')
| -rw-r--r-- | src/site.clj | 10 |
1 files changed, 4 insertions, 6 deletions
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\-_.+]*$")
|
