Saved Searches Plugin


(Neil Lalonde) #1

Following from the new watched words feature that takes action on bad words, here’s a plugin that lets people save a list of searches and get notified if any new topics and posts are created that match their searches.

After installing the plugin, enable it and choose the minimum trust level to allow creating saved searches.

There’s a new section in your preferences where you can define your list of searches.

Once a day, your searches will be performed. If there are new results that you haven’t already seen, you’ll get a private message with a list of links to the posts. If you want to get an email notification, be sure you’ve enabled “Send me an email when someone messages me” in your email settings.

One private message will be created for each of your search terms. Notification of new results will be posted as replies in the corresponding topic.

We’ve enabled it on meta for minimum trust level 2, so give it a try.

(Dave McClure) #2


Alternative idea for the UI:

  • to save a search, click a save button on the search results page.
  • on the preferences tab, just show a list of saved searches with a link to the search result page and a button to delete it.

(Christoph) #3

This is great! Well done!

So it’s a maximum 5 saved searches?

Why this setting? What’s the security risk?


(Christoph) #4

It works fine for me so far, but when I receive a notification about a new topic, I would like to see straight away to which of my search terms each topic corresponds…

(Christoph) #5

Did you change something with the settings? Since yesterday, the results I get from my saved searches are no longer expanded but only show as the topic title link with post-number amended. I much preferred the frevious setting where I can see the actual post straight away.

BTW, I also realized that (if posts are expanded), there would be an easy way to solve this:

and that is to simply highlight the search term in that post.

(Kenny DuBose) #6

@tophee good and simple point you make about just highlighting the search term

(Jeff Atwood) #7

Agreed @neil can we do this? @sam wrote a bunch of nifty code to highlight search matches on the search page, could it be generalized for use here?

(Neil Lalonde) #8

No, the template will show a more compact list if there are more than X results. How many did you get?

Search terms might not appear in the notification message itself. Or do you mean when you click through to the posts?

(Christoph) #9

5 and 7.

I don’t really see the necessity to have this more compact list (in fact, I could click 2 or 3 links but when the list is long you I need the post preview to select the relevant ones that I will actually click on it) but if others see a benefit in the compact list, how about adding the expanded list under the compact one?

(Evgeny) #10

Perhaps the problem is not with this plugin, but it does not work in non-English characters.

(Jay Pfaffman) #11

Is there a reason to have a fixed number of searches rather than just use a list? Is it fear that someone will make a zillion searches and crash the server?

If that’s it, is there a way to have the number be controlled by a site setting? (From my nascent Rails knowledge, I think that’s a “no.”).

Also, could the search run more than once daily?

That is to say, I have a client who wants the search to run more often and needs more than 5 searches. My current solution is to fork the plugin and fix up those things in my forked version. Is there a better way?

(Christoph) #12

If you’ve already fixed things (?) why don’t you submit a PR? To me at least, those changes make perfect sense.

Of course, it would be nice if the search frequency would be a user setting (since it affects how many notifications (and hence emails) you get, but site setting is a good start.

(Jay Pfaffman) #13

I’ve not fixed things. I’m not much of a plugin rebellious, so I was hoping to avoid it. :slight_smile:

(Christoph) #14

Here is another suggestion for this plugin: I notice that the search results are kinda flooding my inbox, making my “real” PMs disappear. How about giving the search result PMs a separate inbox, similar to group inboxes?

(Daniela) #17

PR submitted for italian translation.

Out of curiosity, is this an #official plugin?

(David Taylor) #19

Currently the plugin creates a new PM topic every day (if there’s new results).

How about it making it reply to the existing PM topic instead? That would keep all the results in one place, and remove any inbox-cluttering concerns.

(Jeff Atwood) #21

Oh that’s a very nice idea. Logical as well, each search is its own topic, and we reply with new results. @neil is on vacation (well, not really a vacation, he’s moving which is always painful) so maybe he can look at that when he gets back.

(Neil Lalonde) #23

Definitely a good idea! It’s done. The subject of the messages will show the search term, and each notification is a reply in the topics:

(Christoph) #24

I noticed that the introductory line of the messages has been changed from

New results have been found for your saved searches!


New results have been found for **<search_term> **!

which is great, but if the ** are meant to bolden the search term, it doesn’t work, for some reason.

(Neil Lalonde) #25

Hmm, worked on my machine.

I’ll see what happens when meta finds something for me.