AlgoliaSearchOfflineCore-Android

Core libraries of the Algolia Search Offline SDK for Android. This is a companion library for the offline mode of the Algolia Search Client for Android. It should not be used directly.

License

License

Categories

Categories

Search Business Logic Libraries
GroupId

GroupId

com.algolia
ArtifactId

ArtifactId

algoliasearch-offline-core-android
Last Version

Last Version

1.2.2
Release Date

Release Date

Type

Type

aar
Description

Description

AlgoliaSearchOfflineCore-Android
Core libraries of the Algolia Search Offline SDK for Android. This is a companion library for the offline mode of the Algolia Search Client for Android. It should not be used directly.
Project URL

Project URL

https://github.com/algolia/algoliasearch-client-android
Source Code Management

Source Code Management

https://github.com/algolia/algoliasearch-client-android

Download algoliasearch-offline-core-android

How to add to project

<!-- https://jarcasting.com/artifacts/com.algolia/algoliasearch-offline-core-android/ -->
<dependency>
    <groupId>com.algolia</groupId>
    <artifactId>algoliasearch-offline-core-android</artifactId>
    <version>1.2.2</version>
    <type>aar</type>
</dependency>
// https://jarcasting.com/artifacts/com.algolia/algoliasearch-offline-core-android/
implementation 'com.algolia:algoliasearch-offline-core-android:1.2.2'
// https://jarcasting.com/artifacts/com.algolia/algoliasearch-offline-core-android/
implementation ("com.algolia:algoliasearch-offline-core-android:1.2.2")
'com.algolia:algoliasearch-offline-core-android:aar:1.2.2'
<dependency org="com.algolia" name="algoliasearch-offline-core-android" rev="1.2.2">
  <artifact name="algoliasearch-offline-core-android" type="aar" />
</dependency>
@Grapes(
@Grab(group='com.algolia', module='algoliasearch-offline-core-android', version='1.2.2')
)
libraryDependencies += "com.algolia" % "algoliasearch-offline-core-android" % "1.2.2"
[com.algolia/algoliasearch-offline-core-android "1.2.2"]

Dependencies

compile (1)

Group / Artifact Type Version
com.android.support » support-compat jar 27.1.1

Project Modules

There are no modules declared in this project.

Algolia Search API Client for Android

Our Android API client is legacy, and in maintenance mode only. We recommend using our Kotlin API client which is better suited for Android development.

Algolia Search is a hosted search engine capable of delivering realtime results from the first keystroke.

The Algolia Search API Client for Android lets you easily use the Algolia Search REST API from your Android code.

Build Status GitHub version

Note: If you were using version 2.x of our Android client, read the migration guide to version 3.x.

You can browse the automatically generated reference documentation.

This project is open-source under the MIT License.

Contributing

Your contributions are welcome! Please use our formatting configuration to keep the coding style consistent.

API Documentation

You can find the full reference on Algolia's website.

  1. Contributing

  2. Install

  3. Quick Start

  4. Push data

  5. Configure

  6. Search

  7. List of available methods

  8. Getting Help

  9. List of available methods

Getting Started

Install

Install the Android client by adding the following dependency to your Gradle build file:

dependencies {
    // [...]
    implementation 'com.algolia:algoliasearch-android:3.+'
    // This will automatically update to the latest v3 release when you build your project
}

Quick Start

In 30 seconds, this quick start tutorial will show you how to index and search objects.

Initialize the client

To start, you need to initialize the client. To do this, you need your Application ID and API Key. You can find both on your Algolia account.

Client client = new Client("YourApplicationID", "YourAPIKey");
Index index = client.getIndex("your_index_name");

Warning: If you are building a native app on mobile, make sure not to include the search API key directly in the source code. You should instead consider fetching the key from your servers during the app's startup.

Push data

Without any prior configuration, you can start indexing contacts in the contacts index using the following code:

Index index = client.initIndex("contacts");
index.addObjectAsync(new JSONObject()
     .put("firstname", "Jimmie")
     .put("lastname", "Barninger")
     .put("followers", 93)
     .put("company", "California Paint"), null);
index.addObjectAsync(new JSONObject()
     .put("firstname", "Warren")
     .put("lastname", "Speach")
     .put("followers", 42)
     .put("company", "Norwalk Crmc"), null);

Configure

You can customize settings to fine tune the search behavior. For example, you can add a custom ranking by number of followers to further enhance the built-in relevance:

JSONObject settings = new JSONObject().append("customRanking", "desc(followers)");
index.setSettingsAsync(settings, null);

You can also configure the list of attributes you want to index by order of importance (most important first).

Note: Algolia is designed to suggest results as you type, which means you'll generally search by prefix. In this case, the order of attributes is crucial to decide which hit is the best.

JSONObject settings = new JSONObject()
      .put("searchableAttributes", "lastname")
      .put("searchableAttributes", "firstname")
      .put("searchableAttributes", "company");
index.setSettingsAsync(settings, null);

Search

You can now search for contacts by firstname, lastname, company, etc. (even with typos):

CompletionHandler completionHandler = new CompletionHandler() {
    @Override
    public void requestCompleted(JSONObject content, AlgoliaException error) {
        // [...]
    }
};
// Search for a first name
index.searchAsync(new Query("jimmie"), completionHandler);
// Search for a first name with typo
index.searchAsync(new Query("jimie"), completionHandler);
// Search for a company
index.searchAsync(new Query("california paint"), completionHandler);
// Search for a first name and a company
index.searchAsync(new Query("jimmie paint"), completionHandler);

List of available methods

Personalization

Search

Indexing

Settings

Manage indices

API keys

Synonyms

Query rules

A/B Test

Insights

MultiClusters

Advanced

Getting Help

com.algolia

Algolia

Open source tools for building search. Learn more at community.algolia.com

Versions

Version
1.2.2
1.2.1
1.2.0
1.1.0
1.0.1
1.0
0.2.2
0.2.1
0.2
0.1