Search in sources :

Example 6 with DocumentSummary

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;
}
Also used : SummaryField(com.yahoo.vespa.documentmodel.SummaryField) DocumentSummary(com.yahoo.vespa.documentmodel.DocumentSummary)

Example 7 with DocumentSummary

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;
}
Also used : SummaryField(com.yahoo.vespa.documentmodel.SummaryField) DocumentSummary(com.yahoo.vespa.documentmodel.DocumentSummary)

Example 8 with DocumentSummary

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());
}
Also used : Search(com.yahoo.searchdefinition.Search) DocumentSummary(com.yahoo.vespa.documentmodel.DocumentSummary) Test(org.junit.Test)

Example 9 with DocumentSummary

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;
}
Also used : DocumentSummary(com.yahoo.vespa.documentmodel.DocumentSummary)

Example 10 with DocumentSummary

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);
    }
}
Also used : SummaryField(com.yahoo.vespa.documentmodel.SummaryField) DocumentSummary(com.yahoo.vespa.documentmodel.DocumentSummary)

Aggregations

DocumentSummary (com.yahoo.vespa.documentmodel.DocumentSummary)13 SummaryField (com.yahoo.vespa.documentmodel.SummaryField)10 Attribute (com.yahoo.searchdefinition.document.Attribute)3 SDField (com.yahoo.searchdefinition.document.SDField)2 HashMap (java.util.HashMap)2 Pair (com.yahoo.collections.Pair)1 DataType (com.yahoo.document.DataType)1 TensorDataType (com.yahoo.document.TensorDataType)1 Index (com.yahoo.searchdefinition.Index)1 Search (com.yahoo.searchdefinition.Search)1 BooleanIndexDefinition (com.yahoo.searchdefinition.document.BooleanIndexDefinition)1 Source (com.yahoo.vespa.documentmodel.SummaryField.Source)1 Map (java.util.Map)1 Test (org.junit.Test)1