Search in sources :

Example 6 with AbstractSearchCluster

use of com.yahoo.vespa.model.search.AbstractSearchCluster in project vespa by vespa-engine.

the class ContainerModel method initialize.

@Override
@Deprecated
public void initialize(ConfigModelRepo configModelRepo) {
    List<AbstractSearchCluster> searchClusters = Content.getSearchClusters(configModelRepo);
    Map<String, AbstractSearchCluster> searchClustersByName = new TreeMap<>();
    for (AbstractSearchCluster c : searchClusters) {
        searchClustersByName.put(c.getClusterName(), c);
    }
    getCluster().initialize(searchClustersByName);
}
Also used : AbstractSearchCluster(com.yahoo.vespa.model.search.AbstractSearchCluster) TreeMap(java.util.TreeMap)

Example 7 with AbstractSearchCluster

use of com.yahoo.vespa.model.search.AbstractSearchCluster in project vespa by vespa-engine.

the class NoPrefixForIndexes method validate.

@Override
public void validate(VespaModel model, DeployState deployState) {
    for (AbstractSearchCluster cluster : model.getSearchClusters()) {
        if (cluster instanceof IndexedSearchCluster) {
            IndexedSearchCluster sc = (IndexedSearchCluster) cluster;
            for (DocumentDatabase docDb : sc.getDocumentDbs()) {
                DerivedConfiguration sdConfig = docDb.getDerivedConfiguration();
                Search search = sdConfig.getSearch();
                for (SDField field : search.allConcreteFields()) {
                    if (field.doesIndexing()) {
                        // if (!field.getIndexTo().isEmpty() && !field.getIndexTo().contains(field.getName())) continue;
                        if (field.getMatching().getAlgorithm().equals(Matching.Algorithm.PREFIX)) {
                            failField(search, field);
                        }
                        for (Map.Entry<String, Index> e : field.getIndices().entrySet()) {
                            if (e.getValue().isPrefix()) {
                                failField(search, field);
                            }
                        }
                    }
                }
            }
        }
    }
}
Also used : IndexedSearchCluster(com.yahoo.vespa.model.search.IndexedSearchCluster) DerivedConfiguration(com.yahoo.searchdefinition.derived.DerivedConfiguration) SDField(com.yahoo.searchdefinition.document.SDField) AbstractSearchCluster(com.yahoo.vespa.model.search.AbstractSearchCluster) Search(com.yahoo.searchdefinition.Search) Index(com.yahoo.searchdefinition.Index) DocumentDatabase(com.yahoo.vespa.model.search.DocumentDatabase) Map(java.util.Map)

Example 8 with AbstractSearchCluster

use of com.yahoo.vespa.model.search.AbstractSearchCluster in project vespa by vespa-engine.

the class RoutingSelectorValidator method validate.

@Override
public void validate(VespaModel model, DeployState deployState) {
    for (AbstractSearchCluster cluster : model.getSearchClusters()) {
        if (cluster instanceof IndexedSearchCluster) {
            IndexedSearchCluster sc = (IndexedSearchCluster) cluster;
            String routingSelector = sc.getRoutingSelector();
            if (routingSelector == null)
                continue;
            try {
                new DocumentSelector(routingSelector);
            } catch (com.yahoo.document.select.parser.ParseException e) {
                throw new IllegalArgumentException("Failed to parse routing selector for search cluster '" + sc.getClusterName() + "'", e);
            }
        }
    }
}
Also used : IndexedSearchCluster(com.yahoo.vespa.model.search.IndexedSearchCluster) DocumentSelector(com.yahoo.document.select.DocumentSelector) AbstractSearchCluster(com.yahoo.vespa.model.search.AbstractSearchCluster)

Aggregations

AbstractSearchCluster (com.yahoo.vespa.model.search.AbstractSearchCluster)8 IndexedSearchCluster (com.yahoo.vespa.model.search.IndexedSearchCluster)3 DocumentDatabase (com.yahoo.vespa.model.search.DocumentDatabase)2 DocumentSelector (com.yahoo.document.select.DocumentSelector)1 Index (com.yahoo.searchdefinition.Index)1 Search (com.yahoo.searchdefinition.Search)1 DerivedConfiguration (com.yahoo.searchdefinition.derived.DerivedConfiguration)1 SDDocumentType (com.yahoo.searchdefinition.document.SDDocumentType)1 SDField (com.yahoo.searchdefinition.document.SDField)1 SearchCluster (com.yahoo.vespa.model.search.SearchCluster)1 File (java.io.File)1 IOException (java.io.IOException)1 ArrayList (java.util.ArrayList)1 Map (java.util.Map)1 TreeMap (java.util.TreeMap)1