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));
}
}
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);
}
}
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());
}
}
}
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();
}
}
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);
}
}
Aggregations