Search in sources :

Example 1 with TextIndexES

use of org.apache.jena.query.text.es.TextIndexES in project jena by apache.

the class BaseESTest method setupTransportClient.

/**
     * Make sure that we have connectivity to the locally running ES node.
     * The ES is started during the pre-integration-test phase
     */
@BeforeClass
public static void setupTransportClient() {
    Settings settings = Settings.builder().put("cluster.name", CLUSTER_NAME).build();
    transportClient = new PreBuiltTransportClient(settings);
    try {
        transportClient.addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName(ADDRESS), PORT));
    } catch (UnknownHostException ex) {
        Assert.fail("Failed to create transport client" + ex.getMessage());
    }
    classToTest = new TextIndexES(config(), transportClient, INDEX_NAME);
    Assert.assertNotNull("Transport client was not created successfully", transportClient);
}
Also used : PreBuiltTransportClient(org.elasticsearch.transport.client.PreBuiltTransportClient) UnknownHostException(java.net.UnknownHostException) InetSocketTransportAddress(org.elasticsearch.common.transport.InetSocketTransportAddress) Settings(org.elasticsearch.common.settings.Settings) TextIndexES(org.apache.jena.query.text.es.TextIndexES) BeforeClass(org.junit.BeforeClass)

Aggregations

UnknownHostException (java.net.UnknownHostException)1 TextIndexES (org.apache.jena.query.text.es.TextIndexES)1 Settings (org.elasticsearch.common.settings.Settings)1 InetSocketTransportAddress (org.elasticsearch.common.transport.InetSocketTransportAddress)1 PreBuiltTransportClient (org.elasticsearch.transport.client.PreBuiltTransportClient)1 BeforeClass (org.junit.BeforeClass)1