use of org.apache.solr.handler.clustering.ClusteringComponent in project lucene-solr by apache.
the class CarrotClusteringEngineTest method getClusteringEngine.
private CarrotClusteringEngine getClusteringEngine(String engineName) {
ClusteringComponent comp = (ClusteringComponent) h.getCore().getSearchComponent("clustering");
assertNotNull("clustering component should not be null", comp);
CarrotClusteringEngine engine = (CarrotClusteringEngine) getSearchClusteringEngines(comp).get(engineName);
assertNotNull("clustering engine for name: " + engineName + " should not be null", engine);
return engine;
}
use of org.apache.solr.handler.clustering.ClusteringComponent in project lucene-solr by apache.
the class CarrotClusteringEngineTest method testDeclarationEngineOrder.
@Test
public void testDeclarationEngineOrder() throws Exception {
ClusteringComponent comp = (ClusteringComponent) h.getCore().getSearchComponent("clustering-name-decl-order");
Map<String, SearchClusteringEngine> engines = getSearchClusteringEngines(comp);
assertEquals(Arrays.asList("unavailable", "lingo", "stc", "mock", "default"), new ArrayList<>(engines.keySet()));
assertEquals(LingoClusteringAlgorithm.class, ((CarrotClusteringEngine) engines.get(ClusteringEngine.DEFAULT_ENGINE_NAME)).getClusteringAlgorithmClass());
}
use of org.apache.solr.handler.clustering.ClusteringComponent in project lucene-solr by apache.
the class CarrotClusteringEngineTest method testDeclarationNameDuplicates.
@Test
public void testDeclarationNameDuplicates() throws Exception {
ClusteringComponent comp = (ClusteringComponent) h.getCore().getSearchComponent("clustering-name-dups");
Map<String, SearchClusteringEngine> engines = getSearchClusteringEngines(comp);
assertEquals(Arrays.asList("", "default"), new ArrayList<>(engines.keySet()));
assertEquals(MockClusteringAlgorithm.class, ((CarrotClusteringEngine) engines.get(ClusteringEngine.DEFAULT_ENGINE_NAME)).getClusteringAlgorithmClass());
}
use of org.apache.solr.handler.clustering.ClusteringComponent in project lucene-solr by apache.
the class CarrotClusteringEngineTest method testDefaultEngineOrder.
@Test
public void testDefaultEngineOrder() throws Exception {
ClusteringComponent comp = (ClusteringComponent) h.getCore().getSearchComponent("clustering-name-default");
Map<String, SearchClusteringEngine> engines = getSearchClusteringEngines(comp);
assertEquals(Arrays.asList("stc", "default", "mock"), new ArrayList<>(engines.keySet()));
assertEquals(LingoClusteringAlgorithm.class, ((CarrotClusteringEngine) engines.get(ClusteringEngine.DEFAULT_ENGINE_NAME)).getClusteringAlgorithmClass());
}
Aggregations