Advertisement
vojtarek

EHEC outbreak after 1.5.

Jun 3rd, 2011
484
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 0.66 KB | None | 0 0
  1. SELECT
  2. rank,
  3. --q as query,
  4. id,
  5. guid,
  6. DATE,
  7. SOURCE,
  8. ts_headline('dutch', title, q) AS title,
  9. ts_headline('dutch', text, q) AS text
  10.  
  11. FROM (
  12.  
  13. SELECT
  14. ts_rank_cd(fts, q) AS rank,
  15. sources.SECTION AS SOURCE,
  16. documents.id,
  17. documents.guid,
  18. documents.title,
  19. documents.text,
  20. pubdate+pubtime AS DATE,
  21. q
  22.  
  23. FROM
  24. documents,
  25. sources,
  26. to_tsquery('dutch',
  27. '
  28. hämolytisch-urämische |
  29. EHEC-Darminfektionen |
  30. (EHEC & Darminfektionen) |
  31. Magen-Darm |
  32. Bauchschmerzen |
  33. (blutiger & Durchfall)
  34. '
  35. ) q
  36.  
  37. WHERE
  38. sources.id=documents.source_id AND
  39. documents.fts @@ q
  40. AND documents.LANGUAGE='de'
  41. AND documents.pubDate > '2011-05-01'
  42. ORDER BY rank DESC
  43. LIMIT 800
  44. ) AS foo
  45.  
  46. ORDER BY DATE DESC;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement