Search in sources :

Example 16 with SDField

use of com.yahoo.searchdefinition.document.SDField in project vespa by vespa-engine.

the class IndexingOutputs method process.

@Override
public void process(boolean validate) {
    for (SDField field : search.allConcreteFields()) {
        ScriptExpression script = field.getIndexingScript();
        if (script == null)
            continue;
        Set<String> summaryFields = new TreeSet<>();
        findSummaryTo(search, field, summaryFields, summaryFields);
        MyConverter converter = new MyConverter(search, field, summaryFields, validate);
        field.setIndexingScript((ScriptExpression) converter.convert(script));
    }
}
Also used : SDField(com.yahoo.searchdefinition.document.SDField)

Example 17 with SDField

use of com.yahoo.searchdefinition.document.SDField in project vespa by vespa-engine.

the class LiteralBoost method addLiteralBoostsToFields.

/**
 * Ensures there are field boosts for all literal boosts mentioned in rank profiles.
 * This is required because boost indices will only be generated by looking
 * at field boosts
 */
private void addLiteralBoostsToFields(Search search) {
    Iterator i = matchingRankSettingsIterator(search, RankProfile.RankSetting.Type.LITERALBOOST);
    while (i.hasNext()) {
        RankProfile.RankSetting setting = (RankProfile.RankSetting) i.next();
        SDField field = search.getConcreteField(setting.getFieldName());
        if (field == null)
            continue;
        if (field.getLiteralBoost() < 0)
            field.setLiteralBoost(0);
    }
}
Also used : SDField(com.yahoo.searchdefinition.document.SDField) Iterator(java.util.Iterator) RankProfile(com.yahoo.searchdefinition.RankProfile)

Example 18 with SDField

use of com.yahoo.searchdefinition.document.SDField in project vespa by vespa-engine.

the class OptimizeIlscript method process.

@Override
public void process(boolean validate) {
    for (SDField field : search.allConcreteFields()) {
        ScriptExpression script = field.getIndexingScript();
        if (script == null)
            continue;
        field.setIndexingScript((ScriptExpression) new ExpressionOptimizer().convert(script));
        if (!field.getIndexingScript().toString().equals(script.toString())) {
            warn(search, field, "Rewrote ilscript from:\n" + script.toString() + "\nto\n" + field.getIndexingScript().toString());
        }
    }
}
Also used : SDField(com.yahoo.searchdefinition.document.SDField) ExpressionOptimizer(com.yahoo.vespa.indexinglanguage.ExpressionOptimizer) ScriptExpression(com.yahoo.vespa.indexinglanguage.expressions.ScriptExpression)

Example 19 with SDField

use of com.yahoo.searchdefinition.document.SDField in project vespa by vespa-engine.

the class ImplicitSummaries method process.

@Override
public void process(boolean validate) {
    DocumentSummary defaultSummary = search.getSummary("default");
    if (defaultSummary == null) {
        defaultSummary = new DocumentSummary("default");
        search.addSummary(defaultSummary);
    }
    for (SDField field : search.allConcreteFields()) {
        collectSummaries(field, search, validate);
    }
    for (DocumentSummary documentSummary : search.getSummaries().values()) {
        documentSummary.purgeImplicits();
    }
}
Also used : SDField(com.yahoo.searchdefinition.document.SDField) DocumentSummary(com.yahoo.vespa.documentmodel.DocumentSummary)

Example 20 with SDField

use of com.yahoo.searchdefinition.document.SDField in project vespa by vespa-engine.

the class IndexingInputs method process.

@Override
public void process(boolean validate) {
    for (SDField field : search.allConcreteFields()) {
        ScriptExpression script = field.getIndexingScript();
        if (script == null)
            continue;
        String fieldName = field.getName();
        script = (ScriptExpression) new DefaultToCurrentField(fieldName).convert(script);
        script = (ScriptExpression) new EnsureInputExpression(fieldName).convert(script);
        if (validate)
            new VerifyInputExpression(search, field).visit(script);
        field.setIndexingScript(script);
    }
}
Also used : SDField(com.yahoo.searchdefinition.document.SDField) ScriptExpression(com.yahoo.vespa.indexinglanguage.expressions.ScriptExpression)

Aggregations

SDField (com.yahoo.searchdefinition.document.SDField)85 Test (org.junit.Test)33 SDDocumentType (com.yahoo.searchdefinition.document.SDDocumentType)22 Search (com.yahoo.searchdefinition.Search)15 Attribute (com.yahoo.searchdefinition.document.Attribute)11 Index (com.yahoo.searchdefinition.Index)7 RankProfileRegistry (com.yahoo.searchdefinition.RankProfileRegistry)7 ArrayList (java.util.ArrayList)7 BaseDeployLogger (com.yahoo.config.model.application.provider.BaseDeployLogger)6 Field (com.yahoo.document.Field)6 SummaryField (com.yahoo.vespa.documentmodel.SummaryField)6 ScriptExpression (com.yahoo.vespa.indexinglanguage.expressions.ScriptExpression)6 QueryProfileRegistry (com.yahoo.search.query.profile.QueryProfileRegistry)5 ImmutableSDField (com.yahoo.searchdefinition.document.ImmutableSDField)5 QueryProfiles (com.yahoo.vespa.model.container.search.QueryProfiles)5 ArrayDataType (com.yahoo.document.ArrayDataType)4 DataType (com.yahoo.document.DataType)4 DocumentReference (com.yahoo.searchdefinition.DocumentReference)4 RankProfile (com.yahoo.searchdefinition.RankProfile)4 TemporarySDField (com.yahoo.searchdefinition.document.TemporarySDField)4