Skip to content

Apache Lucene open-source search software

fixed javadoc typo and added helpful diagnostic toString methods

Erik Hatcher835871eedcf6
diff --git a/src/java/org/apache/lucene/search/BooleanClause.java b/src/java/org/apache/lucene/search/BooleanClause.java
index ed1f5a17f78..ff71b2b97ba 100644
--- a/src/java/org/apache/lucene/search/BooleanClause.java
+++ b/src/java/org/apache/lucene/search/BooleanClause.java
@@ -27,7 +27,13 @@ public class BooleanClause implements java.io.Serializable {
// typesafe enum pattern, no public constructor
super(name);
}
-
+
+ public String toString() {
+ if (this == MUST) return "+";
+ if (this == MUST_NOT) return "-";
+ return "";
+ }
+
/** Use this operator for terms that <i>must</i> appear in the matching documents. */
public static final Occur MUST = new Occur("MUST");
/** Use this operator for terms of which <i>should</i> appear in the
@@ -150,4 +156,8 @@ public class BooleanClause implements java.io.Serializable {
return query.hashCode() ^ (this.required?1:0) ^ (this.prohibited?2:0);
}
+
+ public String toString() {
+ return occur.toString() + query.toString();
+ }
}
diff --git a/src/java/org/apache/lucene/search/BooleanQuery.java b/src/java/org/apache/lucene/search/BooleanQuery.java
index 9667a7bc98f..495b7ecd8ec 100644
--- a/src/java/org/apache/lucene/search/BooleanQuery.java
+++ b/src/java/org/apache/lucene/search/BooleanQuery.java
@@ -72,7 +72,7 @@ public class BooleanQuery extends Query {
*
* {@link Similarity#coord(int,int)} may be disabled in scoring, as
* appropriate. For example, this score factor does not make sense for most
- * automatically generated queries, like {@link WildCardQuery} and {@link
+ * automatically generated queries, like {@link WildcardQuery} and {@link
* FuzzyQuery}.
*
* @param disableCoord disables {@link Similarity#coord(int,int)} in scoring.