  We introduce a new method for the identification of galaxy systems in
redshift surveys based on the halo model. This method is a modified version of
the K-means identification algorithm developed by Yang et al (2005). We have
calibrated and tested our algorithms using mock catalogs generated using the
Millennium simulations (Springel et al. 2005) and applied them to the NYU-DR7
galaxy catalog (based on the SDSS datasets). Using this local sample of groups
and clusters of galaxies we have measured the effect of gravitational redshift
produced by their host dark matter haloes. Our results shows radial velocity
decrements consistent with general relativity predictions and previous
measurements by Wojtak et al (2011) in clusters of galaxies.
