小编Saa*_*han的帖子

将对象分配给另一个对象时会发生什么

public class DrumKitTestDrive {
/**
 * @param args
 */
public static void main(String[] args) {
    // TODO Auto-generated method stub
    Echo e1 = new Echo();
    Echo e2 = new Echo();
//      **e2 = e1;**

    int x=0;
    while( x < 4 ){
        e1.hello();
        e1.count = e1.count + 1;
        if(x==3){
            e2.count = e2.count + 1;
        }
        if(x>0){
            e2.count = e2.count + e1.count;
        }
        x = x + 1;
    }
    System.out.print(e2.count);
    }
}

class Echo {
    int  count = 0;

    void hello(){
        System.out.println("Hellooooo...."); …
Run Code Online (Sandbox Code Playgroud)

java object

7
推荐指数
3
解决办法
3万
查看次数

ElasticSearch PutMapping API:MapperParsingException解析后根类型映射不为空

我在我的本地ES 1.3.4实例和JDBC For MySql 1.3.4.4上有一个River

这条河工作正常并在ES中导入数据.问题我面对的是我的一个字段是一个文本字段,并且在其中有空格.例如'实时计算器'.ES将其编入"真实","时间"和"计算器"而不是"实时计算器".

所以我使用下面提到的JSON创建映射:

{
    "sale_test": {
        "properties": {
            "Client": {
                "index": "not_analyzed",
                "type": "string"
            },
            "OfferRGU": {
                "type": "long"
            },
            "SaleDate": {
                "format": "dateOptionalTime",
                "type": "date"
            },
            "State": {
                "type": "string"
            }
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

和命令:

curl -XPUT http://localhost:9200/my_index/_mapping/my_type
Run Code Online (Sandbox Code Playgroud)

但我得到以下提到的错误:

> {"error":"MapperParsingException[Root type mapping not empty after
> parsing! Remaining fields:   [sale_test :
> {properties={Client={type=string, index=not_analyzed},
> OfferRGU={type=long}, SaleDate={type=date, format=dateOptionalTime},
> State={type=string}}}]]","status":400}
Run Code Online (Sandbox Code Playgroud)

当我尝试使用下面提到的命令查看当前映射时:

curl -XGET http://localhost:9200/dgses/sale_test_river/_mapping
Run Code Online (Sandbox Code Playgroud)

我只得到这个:{}

谢谢你的帮助.

mysql elasticsearch

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

标签 统计

elasticsearch ×1

java ×1

mysql ×1

object ×1