Unable to specify if include Chinese when creating index
liketic opened this issue · 0 comments
liketic commented
The create index API support specify whether include Chinese or not through the parameter chn
in keys
and line
. However, the class IndexKey
and IndexLine
didn't expose this field to user.
public JSONObject ToRequestJson() {
JSONObject allKeys = new JSONObject();
JSONArray tokenDict = new JSONArray();
for (String v:token) {
tokenDict.add(v);
}
allKeys.put("type", GetType());
// only text type require token & caseSensitive
if (GetType().equals("text")) {
allKeys.put("token", tokenDict);
allKeys.put("caseSensitive", GetCaseSensitive());
}
allKeys.put("chn", true);
allKeys.put("doc_value", IsDocValue());
allKeys.put("alias", getAlias());
return allKeys;
}
Here I can add a chn
to the request JSON and seems like it works.