Search in sources :

Example 1 with Ranking

use of com.yahoo.searchdefinition.document.Ranking 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.");
    }
}
Also used : Matching(com.yahoo.searchdefinition.document.Matching) Ranking(com.yahoo.searchdefinition.document.Ranking) SDField(com.yahoo.searchdefinition.document.SDField)

Example 2 with Ranking

use of com.yahoo.searchdefinition.document.Ranking in project vespa by vespa-engine.

the class AttributeFields method deriveAttribute.

private void deriveAttribute(ImmutableSDField field, Attribute fieldAttribute) {
    Attribute attribute = getAttribute(fieldAttribute.getName());
    if (attribute == null) {
        attributes.put(fieldAttribute.getName(), fieldAttribute);
        attribute = getAttribute(fieldAttribute.getName());
    }
    Ranking ranking = field.getRanking();
    if (ranking != null && ranking.isFilter()) {
        attribute.setEnableBitVectors(true);
        attribute.setEnableOnlyBitVector(true);
    }
}
Also used : Ranking(com.yahoo.searchdefinition.document.Ranking) Attribute(com.yahoo.searchdefinition.document.Attribute)

Aggregations

Ranking (com.yahoo.searchdefinition.document.Ranking)2 Attribute (com.yahoo.searchdefinition.document.Attribute)1 Matching (com.yahoo.searchdefinition.document.Matching)1 SDField (com.yahoo.searchdefinition.document.SDField)1