use of com.yahoo.search.result.FeatureData in project vespa by vespa-engine.
the class JSONDebugSearcher method search.
public Result search(com.yahoo.search.Query query, Execution execution) {
Result r = execution.search(query);
String propertyName = query.properties().getString(PROPERTYNAME);
if (propertyName != null) {
execution.fill(r);
for (Iterator<Hit> i = r.hits().deepIterator(); i.hasNext(); ) {
Hit h = i.next();
if (h instanceof FastHit) {
FastHit hit = (FastHit) h;
Object o = hit.getField(propertyName);
if (o instanceof JSONString) {
JSONString j = (JSONString) o;
r.getQuery().trace(JSON_FIELD + j.getContent(), false, 5);
}
if (o instanceof StructuredData) {
StructuredData d = (StructuredData) o;
r.getQuery().trace(STRUCT_FIELD + d.toJson(), false, 5);
}
if (o instanceof FeatureData) {
FeatureData d = (FeatureData) o;
r.getQuery().trace(FEATURE_FIELD + d.toJson(), false, 5);
}
}
}
}
return r;
}
Aggregations