Search in sources :

Example 1 with ClusteringComponent

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;
}
Also used : ClusteringComponent(org.apache.solr.handler.clustering.ClusteringComponent)

Example 2 with ClusteringComponent

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());
}
Also used : ClusteringComponent(org.apache.solr.handler.clustering.ClusteringComponent) SearchClusteringEngine(org.apache.solr.handler.clustering.SearchClusteringEngine) Test(org.junit.Test)

Example 3 with ClusteringComponent

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());
}
Also used : ClusteringComponent(org.apache.solr.handler.clustering.ClusteringComponent) SearchClusteringEngine(org.apache.solr.handler.clustering.SearchClusteringEngine) Test(org.junit.Test)

Example 4 with ClusteringComponent

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());
}
Also used : ClusteringComponent(org.apache.solr.handler.clustering.ClusteringComponent) SearchClusteringEngine(org.apache.solr.handler.clustering.SearchClusteringEngine) Test(org.junit.Test)

Aggregations

ClusteringComponent (org.apache.solr.handler.clustering.ClusteringComponent)4 SearchClusteringEngine (org.apache.solr.handler.clustering.SearchClusteringEngine)3 Test (org.junit.Test)3