Can I get this patch accepted?

It makes 3 small changes:

1. the 'reader' field of IndexSearcher is now protected so that it can be extended and accessed by child classes.
2. New method in IndexSearcher called getIndexReader which can obviously be used to obtain the index reader it was created with.
3. MultiSearcher now has a getSearchables() method to return all searchers the multisearcher was created with.


These are essentially the only changes I've made to my local build so if I can get these accepted (this is my second attempt (ug)) then I don't have to patch everytime I upgrade.

Thanks!



--- lucene-1.4.3/src/java/org/apache/lucene/search/IndexSearcher.java 2004-10-07 00:50:21.000000000 -0700
+++ lucene-1.4.3-burton/src/java/org/apache/lucene/search/IndexSearcher.java 2005-02-24 12:19:37.000000000 -0800
@@ -30,7 +30,7 @@
* or [EMAIL PROTECTED] #search(Query,Filter)} methods.
*/
public class IndexSearcher extends Searcher {
- IndexReader reader;
+ protected IndexReader reader;
private boolean closeReader;


  /** Creates a searcher searching the index in the named directory. */
@@ -53,6 +53,10 @@
    this.closeReader = closeReader;
  }

+  public IndexReader getIndexReader() {
+    return reader;
+  }
+
  /**
   * Note that the underlying IndexReader is not closed, if
   * IndexSearcher was constructed with IndexSearcher(IndexReader r).
@@ -139,7 +143,6 @@
    return new TopFieldDocs(totalHits[0], scoreDocs, hq.getFields());
  }

-
// inherit javadoc
public void search(Query query, Filter filter,
final HitCollector results) throws IOException {
diff --new-file --unified --ignore-all-space --recursive lucene-1.4.3/src/java/org/apache/lucene/search/MultiSearcher.java lucene-1.4.3-burton/src/java/org/apache/lucene/search/MultiSearcher.java
--- lucene-1.4.3/src/java/org/apache/lucene/search/MultiSearcher.java 2004-03-29 14:48:03.000000000 -0800
+++ lucene-1.4.3-burton/src/java/org/apache/lucene/search/MultiSearcher.java 2005-02-24 12:16:02.000000000 -0800
@@ -131,7 +131,6 @@
return new TopDocs(totalHits, scoreDocs);
}


-
  public TopFieldDocs search (Query query, Filter filter, int n, Sort sort)
    throws IOException {
    FieldDocSortedHitQueue hq = null;
@@ -157,7 +156,6 @@
    return new TopFieldDocs (totalHits, scoreDocs, hq.getFields());
  }

-
// inherit javadoc
public void search(Query query, Filter filter, final HitCollector results)
throws IOException {
@@ -187,4 +185,8 @@
return searchables[i].explain(query,doc-starts[i]); // dispatch to searcher
}


+  public Searchable[] getSearchables() {
+    return searchables;
+  }
+
}

--

Use Rojo (RSS/Atom aggregator). Visit http://rojo.com. Ask me for an invite! Also see irc.freenode.net #rojo if you want to chat.

Rojo is Hiring! - http://www.rojonetworks.com/JobsAtRojo.html

If you're interested in RSS, Weblogs, Social Networking, etc... then you should work for Rojo! If you recommend someone and we hire them you'll get a free iPod!
Kevin A. Burton, Location - San Francisco, CA
AIM/YIM - sfburtonator, Web - http://peerfear.org/
GPG fingerprint: 5FB2 F3E2 760E 70A8 6174 D393 E84D 8D04 99F1 4412



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to