Skip to content
This repository was archived by the owner on Jan 31, 2022. It is now read-only.

Commit 94235d8

Browse files
algolia-botPLNech
authored andcommitted
Update README [skip ci] (#559)
The README is generated automatically from Algolia's documentation.
1 parent 06bada2 commit 94235d8

File tree

1 file changed

+30
-26
lines changed

1 file changed

+30
-26
lines changed

README.md

Lines changed: 30 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,13 @@ You can find the full reference on [Algolia's website](https://www.algolia.com/d
6262

6363
## Install
6464

65-
Add the following dependency to your `Gradle` build file:
65+
Install the Android client by adding the following dependency to your `Gradle` build file:
6666

6767
```gradle
6868
dependencies {
6969
// [...]
7070
implementation 'com.algolia:algoliasearch-android:3.+'
71-
// This will automatically update to the latest v3 release when you build your project.
71+
// This will automatically update to the latest v3 release when you build your project
7272
}
7373
```
7474

@@ -90,22 +90,26 @@ Index index = client.getIndex("your_index_name");
9090
You should instead consider [fetching the key from your servers](https://www.algolia.com/doc/guides/security/best-security-practices/#api-keys-in-mobile-applications)
9191
during the app's startup.
9292

93+
### Kotlin support
94+
95+
Even though the Android client is written in Java, you can still use it in a Kotlin project, as long as you don't mix Java and Kotlin code in the same file.
96+
9397
## Push data
9498

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

97101
```java
98102
Index index = client.initIndex("contacts");
99103
index.addObjectAsync(new JSONObject()
100-
.put("firstname", "Jimmie")
101-
.put("lastname", "Barninger")
102-
.put("followers", 93)
103-
.put("company", "California Paint"), null);
104+
.put("firstname", "Jimmie")
105+
.put("lastname", "Barninger")
106+
.put("followers", 93)
107+
.put("company", "California Paint"), null);
104108
index.addObjectAsync(new JSONObject()
105-
.put("firstname", "Warren")
106-
.put("lastname", "Speach")
107-
.put("followers", 42)
108-
.put("company", "Norwalk Crmc"), null);
109+
.put("firstname", "Warren")
110+
.put("lastname", "Speach")
111+
.put("followers", 42)
112+
.put("company", "Norwalk Crmc"), null);
109113
```
110114

111115
## Configure
@@ -124,9 +128,9 @@ In this case, the order of attributes is very important to decide which hit is t
124128

125129
```java
126130
JSONObject settings = new JSONObject()
127-
.append("searchableAttributes", "lastname")
128-
.append("searchableAttributes", "firstname")
129-
.append("searchableAttributes", "company");
131+
.append("searchableAttributes", "lastname")
132+
.append("searchableAttributes", "firstname")
133+
.append("searchableAttributes", "company");
130134
index.setSettingsAsync(settings, null);
131135
```
132136

@@ -141,13 +145,13 @@ CompletionHandler completionHandler = new CompletionHandler() {
141145
// [...]
142146
}
143147
};
144-
// search by firstname
148+
// Search for a first name
145149
index.searchAsync(new Query("jimmie"), completionHandler);
146-
// search a firstname with typo
150+
// Search for a first name with typo
147151
index.searchAsync(new Query("jimie"), completionHandler);
148-
// search for a company
152+
// Search for a company
149153
index.searchAsync(new Query("california paint"), completionHandler);
150-
// search for a firstname & company
154+
// Search for a first name and a company
151155
index.searchAsync(new Query("jimmie paint"), completionHandler);
152156
```
153157

@@ -164,7 +168,7 @@ index.searchAsync(new Query("jimmie paint"), completionHandler);
164168

165169
- [Search index](https://algolia.com/doc/api-reference/api-methods/search/?language=android)
166170
- [Search for facet values](https://algolia.com/doc/api-reference/api-methods/search-for-facet-values/?language=android)
167-
- [Search multiple indexes](https://algolia.com/doc/api-reference/api-methods/multiple-queries/?language=android)
171+
- [Search multiple indices](https://algolia.com/doc/api-reference/api-methods/multiple-queries/?language=android)
168172
- [Browse index](https://algolia.com/doc/api-reference/api-methods/browse/?language=android)
169173

170174

@@ -173,7 +177,7 @@ index.searchAsync(new Query("jimmie paint"), completionHandler);
173177
### Indexing
174178

175179
- [Add objects](https://algolia.com/doc/api-reference/api-methods/add-objects/?language=android)
176-
- [Update objects](https://algolia.com/doc/api-reference/api-methods/update-objects/?language=android)
180+
- [Update objects](https://algolia.com/doc/api-reference/api-methods/save-objects/?language=android)
177181
- [Partial update objects](https://algolia.com/doc/api-reference/api-methods/partial-update-objects/?language=android)
178182
- [Delete objects](https://algolia.com/doc/api-reference/api-methods/delete-objects/?language=android)
179183
- [Delete by](https://algolia.com/doc/api-reference/api-methods/delete-by/?language=android)
@@ -229,13 +233,13 @@ index.searchAsync(new Query("jimmie paint"), completionHandler);
229233

230234
### Query rules
231235

232-
- [Save rule](https://algolia.com/doc/api-reference/api-methods/rules-save/?language=android)
233-
- [Batch rules](https://algolia.com/doc/api-reference/api-methods/rules-save-batch/?language=android)
234-
- [Get rule](https://algolia.com/doc/api-reference/api-methods/rules-get/?language=android)
235-
- [Delete rule](https://algolia.com/doc/api-reference/api-methods/rules-delete/?language=android)
236-
- [Clear rules](https://algolia.com/doc/api-reference/api-methods/rules-clear/?language=android)
237-
- [Search rules](https://algolia.com/doc/api-reference/api-methods/rules-search/?language=android)
238-
- [Export rules](https://algolia.com/doc/api-reference/api-methods/rules-export/?language=android)
236+
- [Save rule](https://algolia.com/doc/api-reference/api-methods/save-rule/?language=android)
237+
- [Batch rules](https://algolia.com/doc/api-reference/api-methods/batch-rules/?language=android)
238+
- [Get rule](https://algolia.com/doc/api-reference/api-methods/get-rule/?language=android)
239+
- [Delete rule](https://algolia.com/doc/api-reference/api-methods/delete-rule/?language=android)
240+
- [Clear rules](https://algolia.com/doc/api-reference/api-methods/clear-rules/?language=android)
241+
- [Search rules](https://algolia.com/doc/api-reference/api-methods/search-rules/?language=android)
242+
- [Export rules](https://algolia.com/doc/api-reference/api-methods/export-rules/?language=android)
239243

240244

241245

0 commit comments

Comments
 (0)