use of com.yahoo.vespa.documentmodel.DocumentSummary in project vespa by vespa-engine.
the class AddAttributeTransformToSummaryOfImportedFieldsTest method createDocumentSummary.
private static DocumentSummary createDocumentSummary(String fieldName) {
DocumentSummary summary = new DocumentSummary("mysummary");
summary.add(new SummaryField(fieldName, DataType.INT));
return summary;
}
use of com.yahoo.vespa.documentmodel.DocumentSummary in project vespa by vespa-engine.
the class ValidateFieldTypesTest method createDocumentSummary.
private static DocumentSummary createDocumentSummary(String fieldName, DataType dataType) {
DocumentSummary summary = new DocumentSummary("mysummary");
summary.add(new SummaryField(fieldName, dataType));
return summary;
}
use of com.yahoo.vespa.documentmodel.DocumentSummary in project vespa by vespa-engine.
the class ImplicitSummaryFieldsTestCase method testRequireThatImplicitFieldsAreCreated.
@Test
public void testRequireThatImplicitFieldsAreCreated() throws IOException, ParseException {
Search search = SearchBuilder.buildFromFile("src/test/examples/implicitsummaryfields.sd");
assertNotNull(search);
DocumentSummary docsum = search.getSummary("default");
assertNotNull(docsum);
assertNotNull(docsum.getSummaryField("rankfeatures"));
assertNotNull(docsum.getSummaryField("summaryfeatures"));
assertEquals(2, docsum.getSummaryFields().size());
}
use of com.yahoo.vespa.documentmodel.DocumentSummary in project vespa by vespa-engine.
the class ImplicitSummaries method getOrCreateAttributePrefetchSummary.
private DocumentSummary getOrCreateAttributePrefetchSummary(Search search) {
DocumentSummary summary = search.getSummary("attributeprefetch");
if (summary == null) {
summary = new DocumentSummary("attributeprefetch");
search.addSummary(summary);
}
return summary;
}
use of com.yahoo.vespa.documentmodel.DocumentSummary in project vespa by vespa-engine.
the class ImplicitSummaries method addToDestination.
private void addToDestination(String destinationName, SummaryField summaryField, Search search) {
DocumentSummary destination = search.getSummary(destinationName);
if (destination == null) {
destination = new DocumentSummary(destinationName);
search.addSummary(destination);
destination.add(summaryField);
} else {
SummaryField existingField = destination.getSummaryField(summaryField.getName());
SummaryField merged = summaryField.mergeWith(existingField);
destination.add(merged);
}
}
Aggregations