mirror of https://github.com/apache/lucene.git
toString() now doesn't return "Keyword" etc anymore but prints "indexed, tokenized" etc. Information about termVectors is now also included.
PR:28336 git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@150416 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
bf85d16d96
commit
453a317e1e
|
@ -219,22 +219,34 @@ public final class Field implements java.io.Serializable {
|
||||||
|
|
||||||
/** Prints a Field for human consumption. */
|
/** Prints a Field for human consumption. */
|
||||||
public final String toString() {
|
public final String toString() {
|
||||||
if (isStored && isIndexed && !isTokenized)
|
StringBuffer result = new StringBuffer();
|
||||||
return "Keyword<" + name + ":" + stringValue + ">";
|
if (isStored)
|
||||||
else if (isStored && !isIndexed && !isTokenized)
|
result.append("stored");
|
||||||
return "Unindexed<" + name + ":" + stringValue + ">";
|
if (isIndexed) {
|
||||||
else if (isStored && isIndexed && isTokenized && stringValue!=null)
|
if (result.length() > 0)
|
||||||
return "Text<" + name + ":" + stringValue + ">";
|
result.append(",");
|
||||||
else if (!isStored && isIndexed && isTokenized && readerValue!=null)
|
result.append("indexed");
|
||||||
return "Text<" + name + ":" + readerValue + ">";
|
}
|
||||||
else if (!isStored && isIndexed && isTokenized)
|
if (isTokenized) {
|
||||||
{
|
if (result.length() > 0)
|
||||||
return "UnStored<" + name + ">";
|
result.append(",");
|
||||||
}
|
result.append("tokenized");
|
||||||
else
|
}
|
||||||
{
|
if (storeTermVector) {
|
||||||
return super.toString();
|
if (result.length() > 0)
|
||||||
}
|
result.append(",");
|
||||||
|
result.append("termVector");
|
||||||
|
}
|
||||||
|
result.append('<');
|
||||||
|
result.append(name);
|
||||||
|
result.append(':');
|
||||||
|
if (readerValue != null) {
|
||||||
|
result.append(readerValue.toString());
|
||||||
|
} else {
|
||||||
|
result.append(stringValue);
|
||||||
|
}
|
||||||
|
result.append('>');
|
||||||
|
return result.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue