DefaultSearchClient not found in Algolia playground example

I am intending to migrate my MySQL records into Algolia. My application is using a Java Hibernate Backend with a VueJS frontend. I am trying to follow this search API guide for Java to allow my application to push data from the Java backend. Following the playground examples here.

I can’t seem to import the DefaultSearchClient even after importing the right dependencies as said in the starting guide. This is the pom.xml source code and I am not using any other classes other than the 5 given in the url, what could I be missing here?

Here is my pom.xml and file for reference, tell me if more information is required.

Here is my pom.xml and file for reference, tell me if more information is required.


<?xml version="1.0" encoding="UTF-8"?>
<project xmlns=""



import java.util.Collections;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException; 

public class DefaultClientExample {

  public static void run() throws ExecutionException, InterruptedException, IOException {
    // Create a SearchClient (it's a Closeable, so you can leverage the try-with-resources
    // construction
    // to let the JVM close underlying resources when appropriate)
    try (SearchClient searchClient =
        DefaultSearchClient.create(Main.ALGOLIA_APPLICATION_ID_1, Main.ALGOLIA_API_KEY_1)) { //DefaultSearchClient not found

      // Init an index
      SearchIndex<Employee> index =
          searchClient.initIndex("employees_" + System.getProperty(""), Employee.class);

      List<Employee> employees = Employee.hireEmployees();
      CompletableFuture<BatchIndexingResponse> saveObjectsFuture =
          index.saveObjectsAsync(employees, true);

      // Typed index
      IndexSettings settings =
          new IndexSettings()

      // Typed request/response
      CompletableFuture<SetSettingsResponse> setSettingsFuture = index.setSettingsAsync(settings);

      // Calling get() is blocking on the future to be completed and waitTask is performing Algolia
      // wait operations

      // Performing multiple typed search asynchronously
      CompletableFuture<SearchResult<Employee>> searchAlgoliaFuture =
          index.searchAsync(new Query("algolia"));

      SearchResult<Employee> search = Query("algolia"));

      CompletableFuture<SearchResult<Employee>> searchAppleFuture =
          index.searchAsync(new Query("apple"));

      CompletableFuture<SearchResult<Employee>> searchAmazonFuture =
          index.searchAsync(new Query("amazon"));

      CompletableFuture.allOf(searchAlgoliaFuture, searchAppleFuture, searchAmazonFuture).join();

      System.out.println("Default client :" + search.getHits().get(0).getName());
      System.out.println("Default client :" + searchAlgoliaFuture.get().getHits().get(0).getName());
      System.out.println("Default client :" + searchAppleFuture.get().getHits().get(0).getName());
      System.out.println("Default client :" + searchAmazonFuture.get().getHits().get(0).getName());


I see that you are using the algoliasearch-java-net module. Unfortunately, this module doesn’t implement the DefaultSearchClient as it’s an advanced module for Java11 users willing to not have the dependency on the DefaltSearchClient we provide which is based on Apache.

Here is a code snippet on how to use the java-net package:

SearchConfig config = new SearchConfig.Builder("YourApplicationID", "YourAdminAPIKey").build();
SearchClient client = new SearchClient(config, new JavaNetHttpRequester(config));
SearchIndex index = client.initIndex("your_index_name");
// Enjoy!

Hope this helps!