小编Xav*_*ier的帖子

Elasticsearch _timestamp

我试图_timestamp在索引上定义属性.首先,我创建索引

curl -XPUT 'http://elasticsearch:9200/ppe/'

来自服务器的响应: {"ok":true,"acknowledged":true}

然后我尝试用a定义映射 _timestamp

curl -Xput 'http://elasticsearch:9200/ppe/log/_mapping' -d '{
  "log": {
    "properties": {
      "_ttl": {
        "enabled": true
      },
      "_timestamp": {
        "enabled": true,
        "store": "yes"
      },
      "message": {
        "type": "string",
        "store": "yes"
      },
      "appid": {
        "type": "string",
        "store": "yes"
      },
      "level": {
        "type": "integer",
        "store": "yes"
      },
      "logdate": {
        "type": "date",
        "format": "date_time_no_millis",
        "store": "yes"
      }
    }
  }
}'
Run Code Online (Sandbox Code Playgroud)

我收到服务器的答复

{
  "error": "MapperParsingException[No type specified for property [_timestamp]]",
  "status": 400
}
Run Code Online (Sandbox Code Playgroud)

我的映射有什么问题?

elasticsearch elasticsearch-mapping

8
推荐指数
1
解决办法
6346
查看次数

如何修复在本机模式下找不到的“org.apache.commons.logging.impl.LogFactoryImpl”

在本机模式下运行休息服务时,我得到一个类 org.apache.commons.logging.impl.LogFactoryImpl not found 异常。它在 openjdk 模式下运行良好。

我已经写了一个小的服务休息来解决这个问题。

服务休息:

package org.acme.rest.json;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; 

import io.quarkus.deployment.builditem.substrate.ReflectiveClassBuildItem;
import io.quarkus.deployment.annotations.BuildStep;

@Path("/logs")
public class LogResource {
   private Log log = LogFactory.getLog(LogResource.class);
    @GET
    @Produces(MediaType.TEXT_PLAIN)
    public String hello() {
        log.info("jello");
        return "hello";
    }
}
Run Code Online (Sandbox Code Playgroud)

调用此文件时,我得到


xception handling request 04cf25a8-aafb-4b2a-978e-47a24009b22d-1 to /logs: org.jboss.resteasy.spi.UnhandledException: org.apache.commons.logging.LogConfigurationException: java.lang.ClassNotFoundException: org.apache.commons.logging.impl.LogFactoryImpl (Caused by java.lang.ClassNotFoundException: org.apache.commons.logging.impl.LogFactoryImpl)
Run Code Online (Sandbox Code Playgroud)

apache-commons-logging quarkus

1
推荐指数
1
解决办法
1611
查看次数