1. A method for searching a database for images that are visually similar to query images, comprising using a processor for a) extracting visual features from the images in the database; b) constructing an image anchor graph according to the visual features extracted from the images in the database, wherein the image anchor graph contains a plurality of anchor points corresponding to a subset of images in the database; c) extracting visual features from the query images; d) using an inverted file structure, wherein the inverted file structure is a 2D indexing table, for which x-axis corresponds to anchor ID and y-axis corresponds to an image list storing image IDs of images from the database linked to an anchor point; and e) retrieving images from the database that are similar to one or more query images using a ranking algorithm based on the image anchor graph that compares the visual features extracted from both the query images and the images in the database.