use of com.yahoo.searchdefinition.document.Matching in project vespa by vespa-engine.
the class ValidateFieldWithIndexSettingsCreatesIndex method process.
@Override
public void process(boolean validate) {
if (!validate)
return;
Matching defaultMatching = new Matching();
Ranking defaultRanking = new Ranking();
for (SDField field : search.allConcreteFields()) {
if (field.doesIndexing())
continue;
if (field.doesAttributing())
continue;
if (!field.getRanking().equals(defaultRanking))
fail(search, field, "Fields which are not creating an index or attribute can not contain rank settings.");
if (!field.getMatching().equals(defaultMatching))
fail(search, field, "Fields which are not creating an index or attribute can not contain match settings.");
}
}
use of com.yahoo.searchdefinition.document.Matching in project vespa by vespa-engine.
the class TagType method implementTagType.
private void implementTagType(SDField field) {
field.setDataType(DataType.getWeightedSet(DataType.STRING, true, true));
// Don't set matching and ranking if this field is not attribute nor index
if (!field.doesIndexing() && !field.doesAttributing())
return;
Matching m = field.getMatching();
if (!m.isTypeUserSet())
m.setType(Matching.Type.WORD);
if (field.getRankType() == null || field.getRankType() == RankType.DEFAULT)
field.setRankType((RankType.TAGS));
}
use of com.yahoo.searchdefinition.document.Matching in project vespa by vespa-engine.
the class IndexingScriptChangeMessageBuilder method checkMatching.
private void checkMatching(ChangeMessageBuilder builder) {
Matching currentMatching = currentField.getMatching();
Matching nextMatching = nextField.getMatching();
if (!currentMatching.equals(nextMatching)) {
builder.addChange("matching", toString(currentMatching), toString(nextMatching));
}
}
use of com.yahoo.searchdefinition.document.Matching 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