use of com.yahoo.config.subscription.ConfigGetter in project vespa by vespa-engine.
the class QueryRewriteSearcherTestUtils method createConfigObj.
/**
* Create config object based on config path
*
* @param configPath path for the searcher config
*/
public static RewritesConfig createConfigObj(String configPath) {
ConfigGetter<RewritesConfig> getter = new ConfigGetter<>(RewritesConfig.class);
RewritesConfig config = getter.getConfig(configPath);
return config;
}
use of com.yahoo.config.subscription.ConfigGetter in project vespa by vespa-engine.
the class IndexCombinatorTestCase method testMixedIndicesAndAttributes.
@Test
public void testMixedIndicesAndAttributes() {
String indexInfoConfigID = "file:src/test/java/com/yahoo/prelude/querytransform/test/indexcombinator.cfg";
ConfigGetter<IndexInfoConfig> getter = new ConfigGetter<>(IndexInfoConfig.class);
IndexInfoConfig config = getter.getConfig(indexInfoConfigID);
IndexFacts facts = new IndexFacts(new IndexModel(config, (QrSearchersConfig) null));
Result r = new Execution(transformer, Execution.Context.createContextStub(facts)).search(new Query(QueryTestCase.httpEncode("?query=\"a b\"")));
assertEquals("OR default:\"a b\" attribute1:a b attribute2:a b", r.getQuery().getModel().getQueryTree().getRoot().toString());
r = new Execution(transformer, Execution.Context.createContextStub(facts)).search(new Query(QueryTestCase.httpEncode("?query=\"a b\" \"c d\"")));
assertEquals("OR (AND default:\"a b\" default:\"c d\")" + " (AND default:\"a b\" attribute1:c d)" + " (AND default:\"a b\" attribute2:c d)" + " (AND attribute1:a b default:\"c d\")" + " (AND attribute1:a b attribute1:c d)" + " (AND attribute1:a b attribute2:c d)" + " (AND attribute2:a b default:\"c d\")" + " (AND attribute2:a b attribute1:c d)" + " (AND attribute2:a b attribute2:c d)", r.getQuery().getModel().getQueryTree().getRoot().toString());
}
use of com.yahoo.config.subscription.ConfigGetter in project vespa by vespa-engine.
the class IndexFactsTestCase method createIndexFacts.
private IndexFacts createIndexFacts() {
ConfigGetter<IndexInfoConfig> getter = new ConfigGetter<>(IndexInfoConfig.class);
IndexInfoConfig config = getter.getConfig(INDEXFACTS_TESTING);
List<String> clusterOne = new ArrayList<>();
List<String> clusterTwo = new ArrayList<>();
clusterOne.addAll(Arrays.asList("one", "two"));
clusterTwo.addAll(Arrays.asList("one", "three"));
Map<String, List<String>> clusters = new HashMap<>();
clusters.put("clusterOne", clusterOne);
clusters.put("clusterTwo", clusterTwo);
IndexFacts indexFacts = new IndexFacts(new IndexModel(config, clusters));
return indexFacts;
}
Aggregations