Doug Cutting wrote:

If you add things that will appear in the javadoc then they need javadoc comments.


OK.. Here's a better patch that keeps the protected reader, doesn't have any whitespace changes (sorry) and includes javadoc.

Kevin

--- 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 13:23:26.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. */
@@ -54,6 +54,17 @@
  }

/**
+ * Get the IndexReader used to back this IndexSearcher. Even if you pass a
+ * path or a directory to the IndexSearcher constructor an IndexReader is used
+ * to represent the searcher internally. This can be used to analyze the
+ * IndexReader used to back an IndexSearcher.
+ *
+ */
+ public IndexReader getIndexReader() {
+ return reader;
+ }
+
+ /**
* Note that the underlying IndexReader is not closed, if
* IndexSearcher was constructed with IndexSearcher(IndexReader r).
* If the IndexReader was supplied implicitly by specifying a directory, then
diff --new-file --unified --ignore-all-space -B --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 13:21:48.000000000 -0800
@@ -187,4 +185,14 @@
return searchables[i].explain(query,doc-starts[i]); // dispatch to searcher
}


+ /**
+ * Get the original Searchable that were used to construct this multisearcher.
+ * This can be used to introspect a multisearcher at runtime to verify that
+ * the internal searchable structure is correct or to perform some external
+ * operation on the searchables it contains.
+ */
+ 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