lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ehatc...@apache.org
Subject svn commit: r164934 - /lucene/java/trunk/src/java/org/apache/lucene/search/Hit.java
Date Wed, 27 Apr 2005 01:38:36 GMT
Author: ehatcher
Date: Tue Apr 26 18:38:35 2005
New Revision: 164934

URL: http://svn.apache.org/viewcvs?rev=164934&view=rev
Log:
revamp toString so as to not deal with potential IOException from fetching a document

Modified:
    lucene/java/trunk/src/java/org/apache/lucene/search/Hit.java

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/Hit.java
URL: http://svn.apache.org/viewcvs/lucene/java/trunk/src/java/org/apache/lucene/search/Hit.java?rev=164934&r1=164933&r2=164934&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/Hit.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/Hit.java Tue Apr 26 18:38:35 2005
@@ -108,18 +108,22 @@
   }
 
   /**
-   * Prints the fields of the underlying document for human consumption.
-   * <p/>
-   * If an IOException occurs whilst getting the document, returns null
-   *
-   * @see Document#toString()
+   * Prints the parameters to be used to discover the promised result.
    */
   public String toString() {
-    try {
-      return getDocument().toString();
-    } catch (IOException e) {
-      return null;
+    StringBuffer buffer = new StringBuffer();
+    buffer.append("Hit<");
+    buffer.append(hits.toString());
+    buffer.append(" [");
+    buffer.append(hitNumber);
+    buffer.append("] ");
+    if (resolved) {
+        buffer.append("resolved");
+    } else {
+        buffer.append("unresolved");
     }
+    buffer.append(">");
+    return buffer.toString();
   }
 
 



Mime
View raw message