private String toString(int depth) { StringBuilder buffer = new StringBuilder(); for (int i = 0; i < depth; i++) { buffer.append(" "); } buffer.append(getSummary()); buffer.append("\n"); Explanation[] details = getDetails(); for (int i = 0 ; i < details.length; i++) { buffer.append(details[i].toString(depth+1)); } return buffer.toString(); }
private void buildExplanation(XContentBuilder builder, Explanation explanation) throws IOException { builder.startObject(); builder.field(Fields.VALUE, explanation.getValue()); builder.field(Fields.DESCRIPTION, explanation.getDescription()); Explanation[] innerExps = explanation.getDetails(); if (innerExps != null) { builder.startArray(Fields.DETAILS); for (Explanation exp : innerExps) { buildExplanation(builder, exp); } builder.endArray(); } builder.endObject(); }
private void buildExplanation(XContentBuilder builder, Explanation explanation) throws IOException { builder.field(VALUE.getPreferredName(), explanation.getValue()); builder.field(DESCRIPTION.getPreferredName(), explanation.getDescription()); Explanation[] innerExps = explanation.getDetails(); if (innerExps != null) { builder.startArray(DETAILS.getPreferredName()); for (Explanation exp : innerExps) { builder.startObject(); buildExplanation(builder, exp); builder.endObject(); } builder.endArray(); } }
public static void writeExplanation(StreamOutput out, Explanation explanation) throws IOException { out.writeBoolean(explanation.isMatch()); out.writeString(explanation.getDescription()); Explanation[] subExplanations = explanation.getDetails(); out.writeVInt(subExplanations.length); for (Explanation subExp : subExplanations) { writeExplanation(out, subExp); } if (explanation.isMatch()) { out.writeFloat(explanation.getValue()); } }
@Override public Explanation explain(int docID, Explanation freq) throws IOException { doc.docID = docID; float score = score(docID, freq.getValue()); return Explanation.match(score, "score from " + ScriptedSimilarity.this.toString() + " computed from:", Explanation.match((float) scoreWeight, "weight"), Explanation.match(weight.query.boost, "query.boost"), Explanation.match(weight.field.docCount, "field.docCount"), Explanation.match(weight.field.sumDocFreq, "field.sumDocFreq"), Explanation.match(weight.field.sumTotalTermFreq, "field.sumTotalTermFreq"), Explanation.match(term.docFreq, "term.docFreq"), Explanation.match(term.totalTermFreq, "term.totalTermFreq"), Explanation.match(freq.getValue(), "doc.freq", freq.getDetails()), Explanation.match(doc.getLength(), "doc.length")); } };
private String toString(int depth) { StringBuilder buffer = new StringBuilder(); for (int i = 0; i < depth; i++) { buffer.append(" "); } buffer.append(getSummary()); buffer.append("\n"); Explanation[] details = getDetails(); for (int i = 0 ; i < details.length; i++) { buffer.append(details[i].toString(depth+1)); } return buffer.toString(); }
private String toString(int depth) { StringBuilder buffer = new StringBuilder(); for (int i = 0; i < depth; i++) { buffer.append(" "); } buffer.append(getSummary()); buffer.append("\n"); Explanation[] details = getDetails(); for (int i = 0 ; i < details.length; i++) { buffer.append(details[i].toString(depth+1)); } return buffer.toString(); }
private String toString(int depth) { StringBuilder buffer = new StringBuilder(); for (int i = 0; i < depth; i++) { buffer.append(" "); } buffer.append(getSummary()); buffer.append("\n"); Explanation[] details = getDetails(); for (int i = 0 ; i < details.length; i++) { buffer.append(details[i].toString(depth+1)); } return buffer.toString(); }
@Override public Explanation explain(int doc) { Explanation exp = super.explain(doc); List<Explanation> details = new ArrayList<>(Arrays.asList(exp.getDetails())); details.add(shapeValues.explain(doc)); return Explanation.match(exp.getValue(), exp.getDescription(), details); } };
@Override public Explanation explain(int doc) { Explanation exp = super.explain(doc); List<Explanation> details = new ArrayList<>(Arrays.asList(exp.getDetails())); details.add(shapeValues.explain(doc)); return Explanation.match(exp.getValue(), exp.getDescription(), details); } };
@Override public Explanation explain(int doc) { Explanation exp = super.explain(doc); List<Explanation> details = new ArrayList<>(Arrays.asList(exp.getDetails())); details.add(shapeValues.explain(doc)); return Explanation.match(exp.getValue(), exp.getDescription(), details); } };
ExplainDefinition(final Explanation explanation) { description = explanation.getDescription(); value = explanation.getValue(); is_match = explanation.isMatch(); details = toArray(explanation.getDetails()); }
private void buildExplanation(XContentBuilder builder, Explanation explanation) throws IOException { builder.startObject(); builder.field(Fields.VALUE, explanation.getValue()); builder.field(Fields.DESCRIPTION, explanation.getDescription()); Explanation[] innerExps = explanation.getDetails(); if (innerExps != null) { builder.startArray(Fields.DETAILS); for (Explanation exp : innerExps) { buildExplanation(builder, exp); } builder.endArray(); } builder.endObject(); }
public static void writeExplanation(StreamOutput out, Explanation explanation) throws IOException { out.writeBoolean(explanation.isMatch()); out.writeString(explanation.getDescription()); Explanation[] subExplanations = explanation.getDetails(); out.writeVInt(subExplanations.length); for (Explanation subExp : subExplanations) { writeExplanation(out, subExp); } if (explanation.isMatch()) { out.writeFloat(explanation.getValue()); } }
private void buildExplanation(XContentBuilder builder, Explanation explanation) throws IOException { builder.field(VALUE.getPreferredName(), explanation.getValue()); builder.field(DESCRIPTION.getPreferredName(), explanation.getDescription()); Explanation[] innerExps = explanation.getDetails(); if (innerExps != null) { builder.startArray(DETAILS.getPreferredName()); for (Explanation exp : innerExps) { builder.startObject(); buildExplanation(builder, exp); builder.endObject(); } builder.endArray(); } }
public SerializableExplanation(Explanation explanation) { setValue(explanation.getValue()); setDescription(explanation.getDescription()); Explanation[] details = explanation.getDetails(); if (details == null) { return; } for (Explanation exp : details) { addDetail(new SerializableExplanation(exp)); } }
public static void writeExplanation(StreamOutput out, Explanation explanation) throws IOException { out.writeBoolean(explanation.isMatch()); out.writeString(explanation.getDescription()); Explanation[] subExplanations = explanation.getDetails(); out.writeVInt(subExplanations.length); for (Explanation subExp : subExplanations) { writeExplanation(out, subExp); } if (explanation.isMatch()) { out.writeFloat(explanation.getValue()); } }
public static void writeExplanation(StreamOutput out, Explanation explanation) throws IOException { out.writeBoolean(explanation.isMatch()); out.writeString(explanation.getDescription()); Explanation[] subExplanations = explanation.getDetails(); out.writeVInt(subExplanations.length); for (Explanation subExp : subExplanations) { writeExplanation(out, subExp); } if (explanation.isMatch()) { out.writeFloat(explanation.getValue()); } }
public static void writeExplanation(StreamOutput out, Explanation explanation) throws IOException { out.writeBoolean(explanation.isMatch()); out.writeString(explanation.getDescription()); Explanation[] subExplanations = explanation.getDetails(); out.writeVInt(subExplanations.length); for (Explanation subExp : subExplanations) { writeExplanation(out, subExp); } if (explanation.isMatch()) { out.writeFloat(explanation.getValue()); } }
public static void writeExplanation(StreamOutput out, Explanation explanation) throws IOException { out.writeBoolean(explanation.isMatch()); out.writeString(explanation.getDescription()); Explanation[] subExplanations = explanation.getDetails(); out.writeVInt(subExplanations.length); for (Explanation subExp : subExplanations) { writeExplanation(out, subExp); } if (explanation.isMatch()) { out.writeFloat(explanation.getValue()); } }