Skip to content

Commit 1a4c815

Browse files
committed
Added: userData in IndexSettings
Fix: #577
1 parent 640d7aa commit 1a4c815

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

algoliasearch-core/src/main/java/com/algolia/search/models/settings/IndexSettings.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ public class IndexSettings implements Serializable {
3535
private List<String> camelCaseAttributes;
3636
private Map<String, List<String>> decompoundedAttributes;
3737
private String primary;
38+
private Map<String, Object> userData;
3839

3940
/* filtering-faceting */
4041
private Long maxValuesPerFacet;
@@ -240,6 +241,15 @@ public String getPrimary() {
240241
return primary;
241242
}
242243

244+
public Map<String, Object> getUserData() {
245+
return userData;
246+
}
247+
248+
public IndexSettings setUserData(Map<String, Object> userData) {
249+
this.userData = userData;
250+
return this;
251+
}
252+
243253
public List<String> getAttributesToHighlight() {
244254
return attributesToHighlight;
245255
}

algoliasearch-core/src/test/java/com/algolia/search/integration/index/SettingsTest.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,12 @@ void testSettings() throws ExecutionException, InterruptedException {
127127
put("fi", Collections.singletonList("attribute3"));
128128
}
129129
});
130+
settings.setUserData(
131+
new HashMap<String, Object>() {
132+
{
133+
put("UserData", "Custom Data");
134+
}
135+
});
130136
settings.setKeepDiacriticsOnCharacters("øé");
131137

132138
// Wait for the save object task to finish on the API Side

0 commit comments

Comments
 (0)