use of com.yahoo.vespa.documentmodel.SearchField 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);
}
use of com.yahoo.vespa.documentmodel.SearchField in project vespa by vespa-engine.
the class DocumentModelBuilder method addSearchField.
private static void addSearchField(SDField field, SearchDef searchDef) {
SearchField searchField = new SearchField(field, field.getIndices().containsKey(field.getName()) && field.getIndices().get(field.getName()).getType().equals(Index.Type.VESPA), field.getAttributes().containsKey(field.getName()));
searchDef.add(searchField);
// Add field to views
addToView(field.getIndices().keySet(), searchField, searchDef);
}
Aggregations