What is Algolia

Algolia empowers modern developers to build world class search and discovery experiences without any DevOps.
Libraries with every major language and framework make it easy to enrich your users' experiences. 

API-first search and discovery for your Java applications

Utilize the Algolia open-source Java API client to index your data, configure your search, add analytics and much more.  

Algolia is an API-First Search and Discovery platform that empowers builders to compose experiences at scale. Explore Algolia

Get started

INSTALL (GET A FREE ACCOUNT HERE.)


        
          
            

<! Algolia library with Apache HTTP requester (compatible with Java 8 and above) > 
<dependency>
  <groupId>com.algolia</groupId>
  <artifactId>algoliasearch-core</artifactId>
  <version>3.10.0</version>
</dependency>
<dependency>
  <groupId>com.algolia</groupId>
  <artifactId>algoliasearch-apache</artifactId>
  <version>3.10.0</version>
</dependency>

mvn compile

INDEX


        
          
            

// Sync version
index.saveObjects(Arrays.asList(
    new Contact()
    .setFirstName("Jimmie")
    .setLastName("Barninger")
    .setObjectID("myID"),

    new Contact()
    .setFirstName("Warren")
    .setLastName("Speach")
    .setObjectID("myID2")
));

// Async version
index.saveObjectsAsync(Arrays.asList(
    new Contact()
    .setFirstName("Jimmie")
    .setLastName("Barninger")
    .setObjectID("myID"),

    new Contact()
    .setFirstName("Warren")
    .setLastName("Speach")
    .setObjectID("myID2")
));

SEARCH


        
          
            

SearchIndex<Contact> index = client.initIndex("contacts", Contact.class);

SearchResult<Contact> search1 = index.search(new Query("query string"));

SearchResult<Contact> search2 =
  index
    .search(new Query("query string")
      .setAttributesToRetrieve(Arrays.asList("firstname", "lastname"))
      .setHitsPerPage(50)
    );

// Async version
CompletableFuture<SearchResult<Contact>> search1 = 
  index.searchAsync(new Query("query string"));

CompletableFuture<SearchResult<Contact>> search2 =
  index
    .searchAsync(new Query("query string")
      .setAttributesToRetrieve(Arrays.asList("firstname", "lastname"))
      .setHitsPerPage(50)
    );

Enable anyone to build great Search & Discovery