本文整理汇总了Java中org.apache.lucene.util.ToStringUtils类的典型用法代码示例。如果您正苦于以下问题:Java ToStringUtils类的具体用法?Java ToStringUtils怎么用?Java ToStringUtils使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ToStringUtils类属于org.apache.lucene.util包,在下文中一共展示了ToStringUtils类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: toString
import org.apache.lucene.util.ToStringUtils; //导入依赖的package包/类
@Override
public String toString(String field) {
StringBuilder buffer = new StringBuilder();
buffer.append("spanOr([");
Iterator<SpanQuery> i = clauses.iterator();
while (i.hasNext()) {
SpanQuery clause = i.next();
buffer.append(clause.toString(field));
if (i.hasNext()) {
buffer.append(", ");
}
}
buffer.append("])");
buffer.append(ToStringUtils.boost(getBoost()));
return buffer.toString();
}
示例2: toString
import org.apache.lucene.util.ToStringUtils; //导入依赖的package包/类
@Override
public String toString(String field) {
StringBuilder buffer = new StringBuilder();
buffer.append("spanNear([");
Iterator<SpanQuery> i = clauses.iterator();
while (i.hasNext()) {
SpanQuery clause = i.next();
buffer.append(clause.toString(field));
if (i.hasNext()) {
buffer.append(", ");
}
}
buffer.append("], ");
buffer.append(slop);
buffer.append(", ");
buffer.append(inOrder);
buffer.append(")");
buffer.append(ToStringUtils.boost(getBoost()));
return buffer.toString();
}
示例3: toString
import org.apache.lucene.util.ToStringUtils; //导入依赖的package包/类
/** Prints a user-readable version of this query. */
@Override
public String toString(String field) {
StringBuilder buffer = new StringBuilder();
if (!getField().equals(field)) {
buffer.append(getField());
buffer.append(":");
}
buffer.append(includeLower ? '[' : '{');
// TODO: all these toStrings for queries should just output the bytes, it might not be UTF-8!
buffer.append(lowerTerm != null ? ("*".equals(Term.toString(lowerTerm)) ? "\\*" : Term.toString(lowerTerm)) : "*");
buffer.append(" TO ");
buffer.append(upperTerm != null ? ("*".equals(Term.toString(upperTerm)) ? "\\*" : Term.toString(upperTerm)) : "*");
buffer.append(includeUpper ? ']' : '}');
buffer.append(ToStringUtils.boost(getBoost()));
return buffer.toString();
}
示例4: toString
import org.apache.lucene.util.ToStringUtils; //导入依赖的package包/类
@Override
public String toString(String field) {
StringBuilder buffer = new StringBuilder();
buffer.append("payloadNear([");
Iterator<SpanQuery> i = clauses.iterator();
while (i.hasNext()) {
SpanQuery clause = i.next();
buffer.append(clause.toString(field));
if (i.hasNext()) {
buffer.append(", ");
}
}
buffer.append("], ");
buffer.append(slop);
buffer.append(", ");
buffer.append(inOrder);
buffer.append(")");
buffer.append(ToStringUtils.boost(getBoost()));
return buffer.toString();
}
示例5: toString
import org.apache.lucene.util.ToStringUtils; //导入依赖的package包/类
@Override
public String toString() {
StringBuilder s = new StringBuilder("EliasFanoSequence");
s.append(" numValues " + numValues);
s.append(" numEncoded " + numEncoded);
s.append(" upperBound " + upperBound);
s.append(" lastEncoded " + lastEncoded);
s.append(" numLowBits " + numLowBits);
s.append("\nupperLongs[" + upperLongs.length + "]");
for (int i = 0; i < upperLongs.length; i++) {
s.append(" " + ToStringUtils.longHex(upperLongs[i]));
}
s.append("\nlowerLongs[" + lowerLongs.length + "]");
for (int i = 0; i < lowerLongs.length; i++) {
s.append(" " + ToStringUtils.longHex(lowerLongs[i]));
}
s.append("\nindexInterval: " + indexInterval + ", nIndexEntryBits: " + nIndexEntryBits);
s.append("\nupperZeroBitPositionIndex[" + upperZeroBitPositionIndex.length + "]");
for (int i = 0; i < upperZeroBitPositionIndex.length; i++) {
s.append(" " + ToStringUtils.longHex(upperZeroBitPositionIndex[i]));
}
return s.toString();
}
示例6: toString
import org.apache.lucene.util.ToStringUtils; //导入依赖的package包/类
@Override
public String toString(String field) {
StringBuilder builder = new StringBuilder("blended(terms:[");
for (int i = 0; i < terms.length; ++i) {
builder.append(terms[i]);
float boost = 1f;
if (boosts != null) {
boost = boosts[i];
}
builder.append(ToStringUtils.boost(boost));
builder.append(", ");
}
if (terms.length > 0) {
builder.setLength(builder.length() - 2);
}
builder.append("])");
builder.append(ToStringUtils.boost(getBoost()));
return builder.toString();
}
示例7: toString
import org.apache.lucene.util.ToStringUtils; //导入依赖的package包/类
@Override
public String toString (String field) {
StringBuilder sb = new StringBuilder();
if (sourceClass > 0) {
sb.append("{");
sb.append(sourceClass);
sb.append(": source:");
}
if (targetClass > 0) {
sb.append("{");
sb.append(targetClass);
sb.append(": target:");
}
sb.append("spanRelation(");
sb.append(firstClause.toString(field));
sb.append(")");
if (sourceClass > 0) {
sb.append("}");
}
if (targetClass > 0) {
sb.append("}");
}
sb.append(ToStringUtils.boost(getBoost()));
return sb.toString();
}
示例8: toString
import org.apache.lucene.util.ToStringUtils; //导入依赖的package包/类
@Override
public String toString (String field) {
StringBuffer buffer = new StringBuffer();
buffer.append("focus(");
if (matchTemporaryClass) {
buffer.append("#");
}
if (classNumbers.size() > 1) {
buffer.append("[");
for (int i = 0; i < classNumbers.size(); i++) {
buffer.append((short) classNumbers.get(i) & 0xFF);
if (i != classNumbers.size() - 1) {
buffer.append(",");
}
}
buffer.append("]");
}
else {
buffer.append((short) classNumbers.get(0) & 0xFF).append(": ");
}
buffer.append(this.firstClause.toString());
buffer.append(')');
buffer.append(ToStringUtils.boost(getBoost()));
return buffer.toString();
}
示例9: toString
import org.apache.lucene.util.ToStringUtils; //导入依赖的package包/类
@Override
public String toString (String field) {
StringBuilder sb = new StringBuilder();
sb.append(this.spanName);
sb.append("(");
sb.append(firstClause.toString(field));
sb.append(", ");
sb.append(secondClause.toString(field));
sb.append(", ");
sb.append("[(");
sb.append(distanceUnit);
sb.append("[");
sb.append(minDistance);
sb.append(":");
sb.append(maxDistance);
sb.append("], ");
sb.append(isOrdered ? "ordered, " : "notOrdered, ");
sb.append(exclusion ? "excluded)])" : "notExcluded)])");
sb.append(ToStringUtils.boost(getBoost()));
return sb.toString();
}
示例10: toString
import org.apache.lucene.util.ToStringUtils; //导入依赖的package包/类
/** Prints a user-readable version of this query. */
@Override
public String toString(String field) {
StringBuilder buffer = new StringBuilder();
if (!getField().equals(field)) {
buffer.append(getField());
buffer.append(":");
}
buffer.append(includeLower ? '[' : '{');
buffer.append(lowerTerm != null ? lowerTerm : "*");
buffer.append(" TO ");
buffer.append(upperTerm != null ? upperTerm : "*");
buffer.append(includeUpper ? ']' : '}');
buffer.append(ToStringUtils.boost(getBoost()));
return buffer.toString();
}
示例11: toString
import org.apache.lucene.util.ToStringUtils; //导入依赖的package包/类
@Override
public String toString(String field) {
StringBuilder buffer = new StringBuilder();
boolean needParens = (getBoost() != 1.0)
|| (getMinimumNumberShouldMatch() > 0);
if (needParens) {
buffer.append("(");
}
for (int i = 0; i < terms.size(); i++) {
Term t = terms.get(i);
buffer.append(new TermQuery(t).toString());
if (i != terms.size() - 1) buffer.append(", ");
}
if (needParens) {
buffer.append(")");
}
if (getMinimumNumberShouldMatch() > 0) {
buffer.append('~');
buffer.append(getMinimumNumberShouldMatch());
}
if (getBoost() != 1.0f) {
buffer.append(ToStringUtils.boost(getBoost()));
}
return buffer.toString();
}
示例12: toString
import org.apache.lucene.util.ToStringUtils; //导入依赖的package包/类
/** Prints a user-readable version of this query. */
@Override
public String toString(String field) {
StringBuilder buffer = new StringBuilder();
if (!getField().equals(field)) {
buffer.append(getField());
buffer.append(":");
}
buffer.append(includeLower ? '[' : '{');
// TODO: all these toStrings for queries should just output the bytes, it might not be UTF-8!
buffer.append(lowerTerm != null ? ("*".equals(lowerTerm.utf8ToString()) ? "\\*" : lowerTerm.utf8ToString()) : "*");
buffer.append(" TO ");
buffer.append(upperTerm != null ? ("*".equals(upperTerm.utf8ToString()) ? "\\*" : upperTerm.utf8ToString()) : "*");
buffer.append(includeUpper ? ']' : '}');
buffer.append(ToStringUtils.boost(getBoost()));
return buffer.toString();
}
示例13: toString
import org.apache.lucene.util.ToStringUtils; //导入依赖的package包/类
/** Prints a user-readable version of this query. */
public String toString(String field) {
StringBuffer buffer = new StringBuffer();
if (!term.field().equals(field)) {
buffer.append(term.field());
buffer.append(":");
}
buffer.append(term.text());
buffer.append(ToStringUtils.boost(getBoost()));
return buffer.toString();
}
示例14: toString
import org.apache.lucene.util.ToStringUtils; //导入依赖的package包/类
/** Prints a user-readable version of this query. */
@Override
public String toString(String field) {
StringBuilder buffer = new StringBuilder();
if (!term.field().equals(field)) {
buffer.append(term.field());
buffer.append(":");
}
buffer.append(term.text());
buffer.append(ToStringUtils.boost(getBoost()));
return buffer.toString();
}
示例15: toString
import org.apache.lucene.util.ToStringUtils; //导入依赖的package包/类
@Override
public String toString(final String field) {
final StringBuilder sb = new StringBuilder();
if (!getField().equals(field)) sb.append(getField()).append(':');
return sb.append(minInclusive ? '[' : '{')
.append((min == null) ? "*" : min.toString())
.append(" TO ")
.append((max == null) ? "*" : max.toString())
.append(maxInclusive ? ']' : '}')
.append(ToStringUtils.boost(getBoost()))
.toString();
}