Advertisement
vojtarek

Rozšířené a updatované EHEC

Jun 6th, 2011
534
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 0.73 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. Bauchkrämpfe |
  35. (enteropathische & hämolytisch-urämische) |
  36. (gurke & ehec)
  37. '
  38. ) q
  39.  
  40. WHERE
  41. sources.id=documents.source_id AND
  42. documents.fts @@ q
  43. AND documents.LANGUAGE='de'
  44. AND documents.pubDate > '2011-05-01'
  45. ORDER BY rank DESC
  46. LIMIT 1000
  47. ) AS foo
  48.  
  49. ORDER BY DATE DESC;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement