We adapt the friends of friends algorithm to the analysis of light curves, and show that it can be successfully applied to searches for transient phenomena in large photometric databases. As a test case we search OGLE-III light curves for known dwarf novae. A single combination of control parameters allows to narrow the search to 1% of the data while reaching a $sim$90% detection efficiency. A search involving $sim$2% of the data and three combinations of control parameters can be significantly more effective - in our case a 100% efficiency is reached. The method can also quite efficiently detect semi-regular or strictly periodic variability. We report 28 new variables found in the field of the globular cluster M22, which was examined earlier with the help of periodicity-searching algorithms