use of com.yahoo.searchdefinition.document.FieldSet in project vespa by vespa-engine.
the class IndexSchema method deriveIndexFields.
private void deriveIndexFields(ImmutableSDField field, Search search) {
if (!field.doesIndexing() && !field.isIndexStructureField()) {
return;
}
List<Field> lst = flattenField(field.asField());
if (lst.isEmpty()) {
return;
}
String fieldName = field.getName();
for (Field flatField : lst) {
deriveIndexFields(flatField, search);
}
if (lst.size() > 1) {
FieldSet fieldSet = new FieldSet(fieldName);
for (Field flatField : lst) {
fieldSet.addFieldName(flatField.getName());
}
fieldSets.put(fieldName, fieldSet);
}
}
use of com.yahoo.searchdefinition.document.FieldSet in project vespa by vespa-engine.
the class FieldSetValidity method process.
@Override
public void process(boolean validate) {
if (!validate)
return;
for (FieldSet fieldSet : search.fieldSets().userFieldSets().values()) {
checkFieldNames(search, fieldSet);
checkMatching(search, fieldSet);
checkNormalization(search, fieldSet);
checkStemming(search, fieldSet);
}
}
use of com.yahoo.searchdefinition.document.FieldSet in project vespa by vespa-engine.
the class IndexSchema method getConfig.
@Override
public void getConfig(IndexschemaConfig.Builder icB) {
for (int i = 0; i < fields.size(); ++i) {
IndexField f = fields.get(i);
IndexschemaConfig.Indexfield.Builder ifB = new IndexschemaConfig.Indexfield.Builder().name(f.getName()).datatype(IndexschemaConfig.Indexfield.Datatype.Enum.valueOf(f.getType())).prefix(f.hasPrefix()).phrases(f.hasPhrases()).positions(f.hasPositions());
if (f.getSdType() != null && !f.getSdType().equals(com.yahoo.searchdefinition.Index.Type.VESPA)) {
ifB.indextype(IndexschemaConfig.Indexfield.Indextype.Enum.valueOf(f.getSdType().toString()));
}
if (!f.getCollectionType().equals("SINGLE")) {
ifB.collectiontype(IndexschemaConfig.Indexfield.Collectiontype.Enum.valueOf(f.getCollectionType()));
}
icB.indexfield(ifB);
}
for (FieldSet fieldSet : fieldSets.values()) {
IndexschemaConfig.Fieldset.Builder fsB = new IndexschemaConfig.Fieldset.Builder().name(fieldSet.getName());
for (String f : fieldSet.getFieldNames()) {
fsB.field(new IndexschemaConfig.Fieldset.Field.Builder().name(f));
}
icB.fieldset(fsB);
}
}
Aggregations