Problem: Search results show up after search text has been deleted.

I'm displaying search results in a block view. When deleting the search text and adding a new one, the new results show up, however the old results are still there as well. It seems that search results are cumulated and old results are not deleted.

Since search texts can be deleted I don't assume that this is the intended behavior. Please clarify.

Comments

dragonwize’s picture

Title: Search results are "sticky" » Deleting a search term does not delete tweets
Category: bug » task
Priority: Critical » Normal

It is not intended as a solution but it is a known issue.

The problem lies in the fact that each tweet has an unique ID from Twitter and we, reasonably so, only keep track of each tweet 1 time so that we do not have duplicates. For the twitter module this is not an issue because it only pulls in tweets from specified accounts and a single tweet can only one account. However, searches are not that simple because a multitude of searches could and do show the same tweets.

For example a search for "Hello" and "Hello Dolly" would very likely have some results that are the same tweet. Now if we just simply delete all the tweets associated with that search term when you delete it, you could very well be deleting tweets that belong to either another search term, a user account on the site, or both.

Because of that deleting is not a simple task. It is something I have planned but will require much more code to search and make sure that each tweet does not have any other links.

For now a possible solution for you:

As you say you are displaying in a block, I assume you are using the views module to produce that block. This module adds an extra filter to views that lets you filter the tweets to show only those tweets that belong to a certain search term. By using that you should only be showing the term you want instead of all the tweets.

dragonwize’s picture

Status: Active » Postponed
sheldon rampton’s picture

I'm not going to be able to fix this, for the reasons that dragonwize enumerated. However, my "Twitter delete" module provides one possible solution, by modifying the Twitter module so it deletes all of the old tweets in its database each time it runs:

http://drupal.org/sandbox/sheldon/1943460