@@ -53,8 +53,8 @@ public class Index {
53
53
/** The client to which this index belongs. */
54
54
private Client client ;
55
55
56
- /** This index's name. */
57
- private String indexName ;
56
+ /** This index's name, <b>not URL-encoded</b> . */
57
+ private String rawIndexName ;
58
58
59
59
/** This index's name, URL-encoded. Cached for optimization. */
60
60
private String encodedIndexName ;
@@ -72,11 +72,11 @@ public class Index {
72
72
// Initialization
73
73
// ----------------------------------------------------------------------
74
74
75
- protected Index (@ NonNull Client client , @ NonNull String indexName ) {
75
+ protected Index (@ NonNull Client client , @ NonNull String rawIndexName ) {
76
76
try {
77
77
this .client = client ;
78
- this .encodedIndexName = URLEncoder .encode (indexName , "UTF-8" );
79
- this .indexName = indexName ;
78
+ this .encodedIndexName = URLEncoder .encode (rawIndexName , "UTF-8" );
79
+ this .rawIndexName = rawIndexName ;
80
80
} catch (UnsupportedEncodingException e ) {
81
81
throw new RuntimeException (e ); // should never happen, as UTF-8 is always supported
82
82
}
@@ -87,11 +87,11 @@ protected Index(@NonNull Client client, @NonNull String indexName) {
87
87
// ----------------------------------------------------------------------
88
88
89
89
@ Override public String toString () {
90
- return String .format ("%s{%s}" , this .getClass ().getSimpleName (), getIndexName ());
90
+ return String .format ("%s{%s}" , this .getClass ().getSimpleName (), getRawIndexName ());
91
91
}
92
92
93
- public String getIndexName () {
94
- return indexName ;
93
+ public String getRawIndexName () {
94
+ return rawIndexName ;
95
95
}
96
96
97
97
public Client getClient () {
@@ -1111,7 +1111,7 @@ protected JSONObject getObjects(@NonNull List<String> objectIDs, @Nullable List<
1111
1111
JSONArray requests = new JSONArray ();
1112
1112
for (String id : objectIDs ) {
1113
1113
JSONObject request = new JSONObject ();
1114
- request .put ("indexName" , this .indexName );
1114
+ request .put ("indexName" , this .rawIndexName );
1115
1115
request .put ("objectID" , id );
1116
1116
if (attributesToRetrieve != null ) {
1117
1117
request .put ("attributesToRetrieve" , new JSONArray (attributesToRetrieve ));
0 commit comments