안녕하세요 저는 MySQL 데이터베이스 테이블에 186000 개 이상의 레코드가있는 lostash 2.X 버전에서 다음 scirp 파일을 사용하고 있습니다.이 .conf 파일을 실행하는 동안 하나의 문서 만 탄성 검색 인덱스로로드됩니다. 내가이 쿼리를 사용할 때이 문서의 ID 분명히 당신이하지 않는 것을 의미 그대로 값 "%{id}"
입니다 볼 수MySQL에서 Elasticsearch로 데이터로드
input {
jdbc {
jdbc_connection_string => "jdbc:mysql://localhost/elasticsearch"
jdbc_user => "root"
jdbc_password => "empower"
#jdbc_validate_connection => true
jdbc_driver_library => "/home/wtc082/Documents/com.mysql.jdbc_5.1.5.jar"
jdbc_driver_class => "com.mysql.jdbc.Driver"
statement => "SELECT * FROM index_part_content_local;"
#schedule => "* * * * *"
#codec => "json"
}
}
output {
elasticsearch {
index => "mysqltest"
document_type => "mysqltest_type"
document_id => "%{id}"
hosts => "localhost:9200"
}
}
은 하나의 문서는 지수에게
GET mysqltest/_search
{
"query": {
"match_all": {}
}
}
{
"took": 14,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 1,
"max_score": 1,
"hits": [
{
"_index": "mysqltest",
"_type": "mysqltest_type",
"_id": "%{id}",
"_score": 1,
"_source": {
"partnum": "",
"property1": "",
"property2": "",
"color": "",
"size": "",
"dim": "",
"thumburl": "",
"catid": "6575",
"subcatid": "3813",
"termid": "31999",
"longdesc": "<ul><li>Equipment and Parts<li>GC32-XD Parts<li>D/V Lock Plate Screw</ul>",
"hier1desc": "Heavy Duty Tools/Equipment",
"hier2desc": "Other Heavy Duty Equipment",
"hier3desc": "Hose Crimping Equipment & Accessories",
"aaiabrandid": "BBSC",
"aaiabrandname": "Gates",
"brandimageurl": "es-logo-sm.jpg",
"linecode": "GAT",
"descrp": "D/V Lock Plate Screw",
"@version": "1",
"@timestamp": "2016-12-20T09:16:40.075Z"
}
}
]
}
}
받고있는 전체 문서/결과를 표시 할 수 있습니까? – Val
문서를 업데이트했습니다. 사전에 도움을 주셔서 감사합니다. 발 –