public ImageSearchHits search(BufferedImage image, IndexReader reader) throws IOException {
    ScalableColor sc = null;
    ColorLayout cl = null;
    EdgeHistogram eh = null;
    if (colorHistogramWeight > 0f) {
      sc = new ScalableColor();
      sc.extract(image);
    }
    if (colorDistributionWeight > 0f) {
      cl = new ColorLayout();
      cl.extract(image);
    }
    if (textureWeight > 0f) {
      eh = new EdgeHistogram();
      eh.extract(image);
    }

    float maxDistance = findSimilar(reader, cl, sc, eh);
    return new SimpleImageSearchHits(this.docs, maxDistance);
  }