aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancis Irving <francis@mysociety.org>2010-10-20 15:46:24 +0100
committerFrancis Irving <francis@mysociety.org>2010-10-20 15:46:24 +0100
commit095efc46d2a029b4a72a25c0998adc09f8284e5f (patch)
treea76833e2d30e74650b75d7e9ade1ca749b58492b
parent65302fcf484391ceb3410a9afb21c1e3f50ce058 (diff)
Include snippet in results from search query JSON.
-rw-r--r--app/controllers/track_controller.rb2
-rw-r--r--todo.txt2
2 files changed, 2 insertions, 2 deletions
diff --git a/app/controllers/track_controller.rb b/app/controllers/track_controller.rb
index f24994276..72ee13f98 100644
--- a/app/controllers/track_controller.rb
+++ b/app/controllers/track_controller.rb
@@ -142,6 +142,8 @@ class TrackController < ApplicationController
:incoming_message_id => r[:model].incoming_message_id,
:outgoing_message_id => r[:model].outgoing_message_id,
:comment_id => r[:model].comment_id,
+
+ :snippet => @template.highlight_and_excerpt(r[:model].search_text_main(true), @xapian_object.words_to_highlight, 150)
# XXX would be nice to add links here, but alas the
# code to make them is in views only. See views/request/details.rhtml
}
diff --git a/todo.txt b/todo.txt
index 89366e177..f76f3de2b 100644
--- a/todo.txt
+++ b/todo.txt
@@ -1,8 +1,6 @@
API:
* Displayable status (i.e. text not code) as parameter on info requests
-* Put clips of text in RSS feeds JSONs
- Call @template.helper_function_name from controller to do it
* Get all the tags for a given request in RSS feed JSONs
* Add stuff to allow AJAX callbacks
* Pagination on the Atom feed JSON, so you can get later pages, and/or choose > 25 items