use of com.yahoo.searchdefinition.document.ImmutableSDField 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.ImmutableSDField in project vespa by vespa-engine.
the class FieldSetValidity method checkNormalization.
private void checkNormalization(Search search, FieldSet fieldSet) {
NormalizeLevel.Level fsNorm = null;
for (String fld : fieldSet.getFieldNames()) {
ImmutableSDField field = search.getField(fld);
NormalizeLevel.Level fieldNorm = field.getNormalizing().getLevel();
if (fsNorm == null) {
fsNorm = fieldNorm;
} else {
if (!fsNorm.equals(fieldNorm)) {
warn(search, field.asField(), "The normalization settings for the fields in " + fieldSet + " are inconsistent " + "(explicitly or because of field type). This may lead to recall and ranking issues.");
return;
}
}
}
}
use of com.yahoo.searchdefinition.document.ImmutableSDField in project vespa by vespa-engine.
the class FieldSetValidity method checkStemming.
private void checkStemming(Search search, FieldSet fieldSet) {
Stemming fsStemming = null;
for (String fld : fieldSet.getFieldNames()) {
ImmutableSDField field = search.getField(fld);
Stemming fieldStemming = field.getStemming();
if (fsStemming == null) {
fsStemming = fieldStemming;
} else {
if (!fsStemming.equals(fieldStemming)) {
warn(search, field.asField(), "The stemming settings for the fields in the fieldset '" + fieldSet.getName() + "' are inconsistent (explicitly or because of field type). " + "This may lead to recall and ranking issues.");
return;
}
}
}
}
use of com.yahoo.searchdefinition.document.ImmutableSDField in project vespa by vespa-engine.
the class AddExtraFieldsToDocument method addSummaryField.
private void addSummaryField(Search search, SDDocumentType document, SummaryField field, boolean validate) {
Field docField = document.getField(field.getName());
if (docField == null) {
ImmutableSDField existingField = search.getField(field.getName());
if (existingField == null) {
SDField newField = new SDField(document, field.getName(), field.getDataType(), field.isHeader(), true);
newField.setIsExtraField(true);
document.addField(newField);
} else if (!existingField.isImportedField()) {
document.addField(existingField.asField());
}
} else if (!docField.getDataType().equals(field.getDataType())) {
if (validate)
throw newProcessException(search, field, "Summary field has conflicting type.");
}
}
use of com.yahoo.searchdefinition.document.ImmutableSDField in project vespa by vespa-engine.
the class FieldSetValidity method checkMatching.
private void checkMatching(Search search, FieldSet fieldSet) {
Matching fsMatching = null;
for (String fld : fieldSet.getFieldNames()) {
ImmutableSDField field = search.getField(fld);
Matching fieldMatching = field.getMatching();
if (fsMatching == null) {
fsMatching = fieldMatching;
} else {
if (!fsMatching.equals(fieldMatching)) {
warn(search, field.asField(), "The matching settings for the fields in " + fieldSet + " are inconsistent " + "(explicitly or because of field type). This may lead to recall and ranking issues.");
return;
}
}
}
}
Aggregations