私は100万行以上のデータセットを持っています。私は、logstashを使ってMysqlとelasticsearchを統合しました。 私は、次の 検索時に間違ったデータが表示される
http://localhost:9200/persondetails/Document/_search?q= *
は私が得る、郵便配達にフェッチするには、以下のURLを入力するとき:{
"took": 1,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 2,
"max_score": 1,
"hits": [
{
"_index": "persondetails",
"_type": "Document",
"_id": "%{idDocument}",
"_score": 1,
"_source": {
"iddocument": 514697,
"@timestamp": "2017-08-31T05:18:46.916Z",
"author": "vaibhav",
"expiry_date": null,
"@version": "1",
"description": "ly that",
"creation_date": null,
"type": 1
}
},
{
"_index": "persondetails",
"_type": "Document_count",
"_id": "AV4o0J3OJ5ftvuhV7i0H",
"_score": 1,
"_source": {
"query": {
"term": {
"author": "rishav"
}
}
}
}
]
}
}
それは私のテーブルの行数として間違っています100万以上であり、これは合計が2であることを示しています。私はここで間違いが何かを見つけることができません。オープン
インデックス:persondetails
UUID:4FiGngZcQfS0Xvu6IeHIfg
状況黄:私はそれがこの
- の
PRI:5
担当者:1
docs.count:2
docs.deleted:1054
store.size:125.4キロバイト
pri.store.size:125.4kb
これはあなたの結果から、私のlogstash.confファイル
input {
jdbc {
jdbc_connection_string => "jdbc:mysql://127.0.0.1:3306/persondetails"
jdbc_user => "root"
jdbc_password => ""
schedule => "* * * * *"
jdbc_validate_connection => true
jdbc_driver_library => "/usr/local/Cellar/logstash/5.5.2/mysql-connector-java-3.1.14/mysql-connector-java-3.1.14-bin.jar"
jdbc_driver_class => "com.mysql.jdbc.Driver"
statement => "SELECT * FROM Document"
type => "persondetails"
}
}
output {
elasticsearch {
#protocol=>http
index =>"persondetails"
document_type => "Document"
document_id => "%{idDocument}"
hosts => ["http://localhost:9200"]
stdout{ codec => rubydebug}
}
}
このレスポンスでは、合計は1つです。 – Val
申し訳ありませんが、実際には2.合計は2になっていますが、私のテーブルには10行の行があります。 –
異なるマッピングタイプがあります。あなたが 'GET http:// localhost:9200/persondetails/_search?q = *'を実行するとどうなるでしょうか? – Val