meilisearch / meilisearch-java

Java client for Meilisearch

Home Page:https://meilisearch.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

为什么我尝试了多种方式还是不能上传

HK-hub opened this issue · comments

Description
无论我如何尝试,上传文档,返回的任务状态就是 Fail, 但是索引却可以创建,直接调用 URL 形式可以上传成功,但是使用 SDK 方法就不行,我的数据不包含 NULL 字段了已经,

Expected behavior
上传数据成功,能够再 dashboard 进行展示

Current behavior
数据上传失败

// 构建数据
        MessageDocument messageDocument = this.buildMessageDocument(flow);
        String jsonString = JSON.toJSONString(messageDocument);
        // 更新文档
        try {
            Client client = new Client(new Config("http://47.120.6.12:7700/", null));
            Index index = client.index("flow");
            TaskInfo taskInfo = index.addDocuments(jsonString);
            // 查询任务状态
            Task task = this.client.getTask(taskInfo.getTaskUid());
            log.info("add document task status:{}", task);
            return null;
        } catch (MeilisearchException e) {
            log.info("add document failed:{}", messageDocument, e);
        }

Screenshots or Logs
image

Environment (please complete the following information):

  • OS: Windows 10
  • Meilisearch version: v1.1.0
  • meilisearch-java version: 对应版本
  • JDK:11

Hi, @HK-hub can you translate your message to English? I don't think my google translation was reliable enough to understand your issue!

Also, if possible please tell me what's the error inside of the "error" field in your exception.

Okay, here is the description of my problem:

No matter how I try to upload documents, the returned task status is Fail, but the index can be created, the direct call to the 

URL form can be uploaded successfully, but not using the SDK method, my data does not contain the NULL field already, and 

the whole process does not generate exceptions, try- catch block does not catch any exception, only the taskInfo after 

addDocuments and then the task response information obtained by client.getTash(), status is only a failed, but no other 

information, detail fields, etc., no hint 

HI @HK-hub have you tried to do what I mention here #585?

I would like to discard any possible problem with the java version or something like that. So if you could run a small project it would help me do that.

Since you're telling me there is nothing besides the failed task, can you share the configurations of your index and also the content of the document are you trying to insert?

Hi @HK-hub,

the whole process does not generate exceptions

This is an expected behavior, the tasks are performed asynchronously, which means that the SDK request was successful. The error may lie in the way the request is formulated.

status is only a failed, but no other information, detail fields

You should have data in your @TaskError object containing a code, link or type

With no response for several weeks, we consider this problem resolved.