@@ -0,0 +1,2744 @@
+/*%0A * Copyright 2011 Greplin, Inc. All Rights Reserved.%0A */%0A%0Apackage com.greplin.lucene.search;%0A%0Aimport org.apache.lucene.document.Document;%0Aimport org.apache.lucene.document.FieldSelector;%0Aimport org.apache.lucene.index.Term;%0Aimport org.apache.lucene.search.Collector;%0Aimport org.apache.lucene.search.Explanation;%0Aimport org.apache.lucene.search.Filter;%0Aimport org.apache.lucene.search.Query;%0Aimport org.apache.lucene.search.Searchable;%0Aimport org.apache.lucene.search.Sort;%0Aimport org.apache.lucene.search.TopDocs;%0Aimport org.apache.lucene.search.TopFieldDocs;%0Aimport org.apache.lucene.search.Weight;%0A%0Aimport java.io.IOException;%0A%0A/**%0A * Convenience class to make tweaking the behavior of a seacher easy.%0A */%0Apublic class ForwardingSearchable implements Searchable %7B%0A%0A  /**%0A   * The searchable to forward to.%0A   */%0A  private final Searchable searcher;%0A%0A%0A  /**%0A   * Creates a new forwarding searchable.%0A   * @param searcher the searchable to forward to%0A   */%0A  public ForwardingSearchable(final Searchable searcher) %7B%0A    this.searcher = searcher;%0A  %7D%0A%0A  @Override%0A  public void search(final Weight weight,%0A                     final Filter filter,%0A                     final Collector results) throws IOException %7B%0A    searcher.search(weight, filter, results);%0A  %7D%0A%0A%0A  @Override%0A  public void close() throws IOException %7B%0A    searcher.close();%0A  %7D%0A%0A%0A  @Override%0A  public int docFreq(final Term term) throws IOException %7B%0A    return searcher.docFreq(term);%0A  %7D%0A%0A%0A  @Override%0A  public int%5B%5D docFreqs(final Term%5B%5D terms) throws IOException %7B%0A    return searcher.docFreqs(terms);%0A  %7D%0A%0A%0A  @Override%0A  public int maxDoc() throws IOException %7B%0A    return searcher.maxDoc();%0A  %7D%0A%0A%0A  @Override%0A  public TopDocs search(final Weight weight,%0A                        final Filter filter,%0A                        final int n) throws IOException %7B%0A    return searcher.search(weight, filter, n);%0A  %7D%0A%0A%0A  @Override%0A  public Document doc(final int i) throws IOException %7B%0A    return searcher.doc(i);%0A  %7D%0A%0A%0A  @Override%0A  public Document doc(final int docid,%0A                      final FieldSelector fieldSelector) throws IOException %7B%0A    return searcher.doc(docid, fieldSelector);%0A  %7D%0A%0A%0A  @Override%0A  public Query rewrite(final Query query) throws IOException %7B%0A    return searcher.rewrite(query);%0A  %7D%0A%0A%0A  @Override%0A  public Explanation explain(final Weight weight,%0A                             final int doc) throws IOException %7B%0A    return searcher.explain(weight, doc);%0A  %7D%0A%0A%0A  @Override%0A  public TopFieldDocs search(final Weight weight,%0A                             final Filter filter,%0A                             final int n,%0A                             final Sort sort) throws IOException %7B%0A    return searcher.search(weight, filter, n, sort);%0A  %7D%0A%7D%0A

Add forwarding searcher utility