0
我想填充我的elasticsearch索引从mysql查询开始。我在Windows上工作,我的批处理是这样的:elasticsearch jdbc类型映射
echo {^
"type" : "jdbc",^
"jdbc" : {^
"url" : "jdbc:mysql://localhost:3306/ade_ver",^
"user" : "...",^
"password" : "...",^
"sql" : select ... ",^
"index" : "ade_ver",^
"type" : "my_type",^
"type_mapping": "{\"my_type\":{\"properties\":{\"prop1\":{\"type\":\"string\"},\"prop2\":{\"type\":\"string\"},**\"prop3\":{\"type\":\"string\",\"index\":\"not_analyzed\"}**, ecc.. }}}",^
"elasticsearch" : {^
"cluster" : "elasticsearch",^
"host" : "localhost",^
"port" : 9300^
}^
}^
} | "%JAVA_HOME%\bin\java" ecc..
现在,一切工作正常,我的索引填充预期数据。 问题是,每个字段都设置为“分析”,即使我试图将其中一些设置为未分析。我错在哪里?
导入数据试试我的旧文章http://stackoverflow.com/questions/27063028/elasticsearch-object-映射和获取数据从数据库 – AlainIb
我做了两步,映射然后jdbc。它为我工作。 – AlainIb
或这篇文章太 http://stackoverflow.com/questions/26486037/elasticsearch-mapping-tokenizer-keyword-to-avoid-splitting-tokens-and-enable-use – AlainIb