Search in sources :

Example 1 with SearchDef

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);
}
Also used : SDField(com.yahoo.searchdefinition.document.SDField) SearchField(com.yahoo.vespa.documentmodel.SearchField) Field(com.yahoo.document.Field) SearchDef(com.yahoo.vespa.documentmodel.SearchDef) SearchField(com.yahoo.vespa.documentmodel.SearchField) SDField(com.yahoo.searchdefinition.document.SDField) Attribute(com.yahoo.searchdefinition.document.Attribute)

Aggregations

Field (com.yahoo.document.Field)1 Attribute (com.yahoo.searchdefinition.document.Attribute)1 SDField (com.yahoo.searchdefinition.document.SDField)1 SearchDef (com.yahoo.vespa.documentmodel.SearchDef)1 SearchField (com.yahoo.vespa.documentmodel.SearchField)1