use of com.yahoo.vespa.documentmodel.SearchDef in project vespa by vespa-engine.
the class DocumentModelBuilder method addToModel.
public void addToModel(Search search) {
// Then we add the search specific stuff
SearchDef searchDef = new SearchDef(search.getName());
addSearchFields(search.extraFieldList(), searchDef);
for (Field f : search.getDocument().fieldSet()) {
addSearchField((SDField) f, searchDef);
}
for (SDField field : search.allConcreteFields()) {
for (Attribute attribute : field.getAttributes().values()) {
if (!searchDef.getFields().containsKey(attribute.getName())) {
searchDef.add(new SearchField(new Field(attribute.getName(), field), !field.getIndices().isEmpty(), true));
}
}
}
for (Field f : search.getDocument().fieldSet()) {
addAlias((SDField) f, searchDef);
}
model.getSearchManager().add(searchDef);
}
Aggregations