I second this. It would greatly improve the search to exclude the already followed titles.
In the UI (yes, I know it's generated code):
diff -r a5d4f4b0cbc6 -r 0749a0feb96a search.htm
--- a/search.htm Sun Sep 20 20:13:26 2015 +0100
+++ b/search.htm Sun Sep 20 21:17:58 2015 +0200
@@ -813,6 +813,13 @@
</td>
</tr>
<tr>
+ <td style="text-align: right; font-weight: bold;">Include My Follows:</td>
+ <td style="text-align: left; vertical-align: top; padding: 8px 0;">
+ <label><input type="radio" name="follows" value="y" checked="checked"/> Yes</label>
+ <label><input type="radio" name="follows" value="n" /> No</label>
+ </td>
+ </tr>
+ <tr>
<td style="text-align: right; font-weight: bold; border-bottom: 1px solid #999999;">Type:</td>
<td style="text-align: left; vertical-align: top; padding: 8px 0; border-bottom: 1px solid #999999;">
<label><input type="radio" name="type" value="any" checked="checked"/> Any</label>
On the backend a conditionally added clause along those lines:
WHERE titleid NOT IN (SELECT titleid FROM follows WHERE userid = :1)
The subquery is costly, but if made optional (non-default) this should not impact query time too much. Yes, someone following all the titles could run into db timeout (2006 or sth like that), so I'd give this option only to users with less than % and more than % follows
. BTW this - and any reference to follows - can be probably optimized (e.g. http://stackoverflow.com/questions/3645794/sql-not-in-subquery-optimization-or-alternatives).
Yes, I can code this for you if needed - it would really ease-up my browsing...