I'm creating a notification system for particular events.
A user can set the criteria that match particular events (ie. New item, changed item, closed item etc) Items have different characteristics (ie. Minor, Major, Critical). So a user may set up a search for All New Critical Items.
What is the most efficient way to identify the ones that match the users' saved searches and send notifications to them every time an event happens?
One way would be to run ALL the saved searches for all users, every time an event happens and see which items are in those search results and send notifications.
The problem with this method I see is that it is inefficient (saved searches could become quite a few) and the complexity of this algorithm is directly proportional to the number of searches.
Does anyone know how websites, such as property websites do it? They send out emails for new properties that match users' searches.
I'm thinking of a way to map new events to users, given their search somehow without running all the searches.