AWS 插件扩展开发参考指南

入库内容示例

createIndexByContent

com.actionsoft.apps.poc.plugin.web.SampleWeb#createFSIndex

public String createFSIndex(String myContent, String myCustomerName, String myCustomerId) {
    // 调用方
    String sourceAppId = "com.actionsoft.apps.poc.plugin";
    // 服务地址
    String aslp = "aslp://com.actionsoft.apps.fullsearch/createIndexByContent";
    Map<String, Object> params = new HashMap<String, Object>();
    // 给定必填参数
    params.put("repositoryName", "db1");
    params.put("documentId", UUIDGener.getUUID());
    params.put("content", myContent);
    JSONArray extendFields = new JSONArray();
    // 扩展客户名称字段
    JSONObject customerNameField = new JSONObject();
    customerNameField.put("fieldName", "customerName");
    customerNameField.put("fieldType", "text");
    customerNameField.put("fieldContent", myCustomerName);
    customerNameField.put("fieldBoost", 1);
    customerNameField.put("fieldStore", true);// 可以返回到查询结果
    // 扩展客户ID字段
    JSONObject customerIdField = new JSONObject();
    customerIdField.put("fieldName", "customerId");
    customerIdField.put("fieldType", "text");
    customerIdField.put("fieldContent", myCustomerId);
    customerIdField.put("fieldBoost", 1);
    customerIdField.put("fieldStore", true);// 可以返回到查询结果

    extendFields.add(customerNameField);
    extendFields.add(customerIdField);
    params.put("otherFields", extendFields.toString());
    ResponseObject ro = SDK.getAppAPI().callASLP(SDK.getAppAPI().getAppContext(sourceAppId), aslp, params);
    return ro.toString();
}

验证

进入AWS CONSOLE > 应用管理并打开你的应用,在部署中点击FullSearchSample,在弹出的对话框中输入信息后点击入库操作按钮



Seven
 010-62962343-690
 liujx@actionsoft.com.cn
感谢您对该文档的关注!如果您对当前页面内容有疑问或好的建议,请与我联系。如果您需要解答相关技术问题请登录AWS客户成功社区