@Override
 public String toString(String field) {
   StringBuilder buffer = new StringBuilder();
   buffer.append("spanPayCheck(");
   buffer.append(match.toString(field));
   buffer.append(", payloadRef: ");
   for (byte[] bytes : payloadToMatch) {
     ToStringUtils.byteArray(buffer, bytes);
     buffer.append(';');
   }
   buffer.append(")");
   buffer.append(ToStringUtils.boost(getBoost()));
   return buffer.toString();
 }
Exemplo n.º 2
0
 @Override
 public String toString(String field) {
   StringBuilder buffer = new StringBuilder();
   buffer.append("*:^");
   buffer.append(ToStringUtils.boost(getBoost()));
   return buffer.toString();
 }
  @Override
  public String toString(String field) {
    StringBuilder buffer = new StringBuilder();
    boolean needParens = (getLowFreqMinimumNumberShouldMatch() > 0);
    if (needParens) {
      buffer.append("(");
    }
    for (int i = 0; i < terms.size(); i++) {
      Term t = terms.get(i);
      buffer.append(newTermQuery(t, null).toString());

      if (i != terms.size() - 1) buffer.append(", ");
    }
    if (needParens) {
      buffer.append(")");
    }
    if (getLowFreqMinimumNumberShouldMatch() > 0 || getHighFreqMinimumNumberShouldMatch() > 0) {
      buffer.append('~');
      buffer.append("(");
      buffer.append(getLowFreqMinimumNumberShouldMatch());
      buffer.append(getHighFreqMinimumNumberShouldMatch());
      buffer.append(")");
    }
    buffer.append(ToStringUtils.boost(getBoost()));
    return buffer.toString();
  }
  /** Prints a user-readable version of this query. */
  @Override
  public final String toString(String f) {
    StringBuilder buffer = new StringBuilder();
    if (field == null || !field.equals(f)) {
      buffer.append(field);
      buffer.append(":");
    }

    buffer.append("\"");
    Iterator<Term[]> i = termArrays.iterator();
    while (i.hasNext()) {
      Term[] terms = i.next();
      if (terms.length > 1) {
        buffer.append("(");
        for (int j = 0; j < terms.length; j++) {
          buffer.append(terms[j].text());
          if (j < terms.length - 1) buffer.append(" ");
        }
        buffer.append(")");
      } else {
        buffer.append(terms[0].text());
      }
      if (i.hasNext()) buffer.append(" ");
    }
    buffer.append("\"");

    if (slop != 0) {
      buffer.append("~");
      buffer.append(slop);
    }

    buffer.append(ToStringUtils.boost(getBoost()));

    return buffer.toString();
  }
Exemplo n.º 5
0
 @Override
 public String toString(String field) {
   StringBuilder sb = new StringBuilder();
   sb.append("boost(").append(q.toString(field)).append(',').append(boostVal).append(')');
   sb.append(ToStringUtils.boost(getBoost()));
   return sb.toString();
 }
 @Override
 public String toString(String field) {
   return new StringBuilder("ConstantScore(")
       .append((query == null) ? filter.toString() : query.toString(field))
       .append(')')
       .append(ToStringUtils.boost(getBoost()))
       .toString();
 }
 /*     */ public String toString(String field) {
   /*  54 */ StringBuilder buffer = new StringBuilder();
   /*  55 */ buffer.append("spanFirst(");
   /*  56 */ buffer.append(this.match.toString(field));
   /*  57 */ buffer.append(", ");
   /*  58 */ buffer.append(this.end);
   /*  59 */ buffer.append(")");
   /*  60 */ buffer.append(ToStringUtils.boost(getBoost()));
   /*  61 */ return buffer.toString();
   /*     */ }
Exemplo n.º 8
0
 /* (non-Javadoc) @see org.apache.lucene.search.Query#toString(java.lang.String) */
 @Override
 public String toString(String field) {
   StringBuilder sb = new StringBuilder(name()).append("(");
   sb.append(subQuery.toString(field));
   for (int i = 0; i < valSrcQueries.length; i++) {
     sb.append(", ").append(valSrcQueries[i].toString(field));
   }
   sb.append(")");
   sb.append(strict ? " STRICT" : "");
   return sb.toString() + ToStringUtils.boost(getBoost());
 }
Exemplo n.º 9
0
 @Override
 public String toString(String field) {
   StringBuilder sb = new StringBuilder();
   sb.append("ParentQuery[")
       .append(parentType)
       .append("](")
       .append(originalParentQuery.toString(field))
       .append(')')
       .append(ToStringUtils.boost(getBoost()));
   return sb.toString();
 }
Exemplo n.º 10
0
 @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();
 }
Exemplo n.º 11
0
 @Override
 public String toString(String defaultField) {
   StringBuilder sb = new StringBuilder();
   sb.append(field).append(": [");
   for (Long number : numbers) {
     sb.append(number).append(", ");
   }
   if (numbers.size() > 0) {
     sb.setLength(sb.length() - 2);
   }
   return sb.append(']').append(ToStringUtils.boost(getBoost())).toString();
 }
 public String toString(String field) {
   StringBuilder sb = new StringBuilder();
   sb.append("score_child[")
       .append(childType)
       .append("/")
       .append(parentType)
       .append("](")
       .append(originalChildQuery.toString(field))
       .append(')');
   sb.append(ToStringUtils.boost(getBoost()));
   return sb.toString();
 }
Exemplo n.º 13
0
 @Override
 public String innerToString(String s) {
   final StringBuilder sb = new StringBuilder();
   return sb.append(names.indexName())
       .append(':')
       .append(includeLower ? '[' : '{')
       .append((lowerTerm == null) ? "*" : lowerTerm.toString())
       .append(" TO ")
       .append((upperTerm == null) ? "*" : upperTerm.toString())
       .append(includeUpper ? ']' : '}')
       .append(ToStringUtils.boost(getBoost()))
       .toString();
 }
 @Override
 public String toString(String field) {
   StringBuilder buffer = new StringBuilder();
   buffer.append(hashFieldName);
   buffer.append(",");
   buffer.append(Arrays.toString(hashes));
   buffer.append(",");
   buffer.append(maxResult);
   buffer.append(",");
   buffer.append(luceneFieldName);
   buffer.append(",");
   buffer.append(lireFeature.getClass().getSimpleName());
   buffer.append(ToStringUtils.boost(getBoost()));
   return buffer.toString();
 }
 @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();
 }
Exemplo n.º 16
0
 /** 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();
 }