当我们通过kibana监控Elasticsearch集群的运行状况时,对于特定索引,我们看到了更高的索引率。但是看来文件数量并没有按比例增加。如何解决这两个问题。
示例文档
{ “ _index”:“ finance_report_fgl_reporting_log”, “ _type”:“ fgl_reporting_logs”, “ _id”:“ 1907688_POINTS_ACCOUNT_DEBIT”, “ _score”:9.445704, “_资源”: { “ reportingLogId”:{ “ journalId”:1907688, “ postingAccountId”:“ POINTS_ACCOUNT”, “ postingAccountingEntry”:“借方” }, “ journalId”:1907688, “ journalEventId”:“ trip_completed”, “ journalEventLogId”:“ 15db1f2b-b9d0-4edd-96f0-c4e4f8e68150”, “ journalAccountingRuleId”:“ trip_completed_points_payment_rule”, “ journalReferenceId”:“ 174558200”, “ journalGrossAmount”:154.11, “ postingJournalId”:1907688, “ postingAccountingRuleId”:“ trip_completed_points_payment_rule”, “ postingReferenceId”:“ 174558200”, “ postingAccountId”:“ POINTS_ACCOUNT”, “ postingAccountingPeriod”:“ 2019_08”, “ postingAccountingEntry”:“ DEBIT”, “ postingCurrencyTypeId”:“ POINTS”, “ postingAmount”:154.11, “ accountId”:“ POINTS_ACCOUNT”, “ accountStakeholderId”:“ OPERATOR”, “ accountCurrencyTypeId”:“要点”, “ accountTypeId”:“ CONTROLLER”, “ accountingRuleId”:“ trip_completed_points_payment_rule”, “ accountingRuleDescription”:“积分支付”, “ eventId”:“ trip_completed”, “ eventReferenceParam”:“ body.trip.id”, “ createdDate”:“ 2019-08-29T10:03:32.000 + 0530”, “ modifiedDate”:“ 2019-08-29T10:03:32.000 + 0530”, “ createdBy”:“ ENGINE”, “ modifiedBy”:“ ENGINE”, “ version”:“ 3.12.6”, “ createYear”:2019年, “ routingKey”:“ _2019” } }
答案 0 :(得分:0)
通常会发生这种情况的原因是,您的索引操作不会创建新文档而是会更新现有文档。主要是因为您要将更新发送到已经存在的ID。
每隔几个小时,就会创建一批新的文档(根据图表中的跳转),因为您正在创建一组新的ID。
由于解决方案隐藏在某处,因此请确保验证如何创建ID。
答案 1 :(得分:0)
执行GET _cat/indices?v
可能会得到一些信息,请检查“ docs.deleted”列,因为更新操作仅仅是“创建新的+删除较旧的”操作。