0
我正在使用彈性搜索,並且對此技術是新的。我想知道「如何在更新couchdb相關文檔時自動更新elasticsearch索引行」? 例如 我有一個像下面 purchage分貝行如何在nodejs中使用elasticsearch更新couchdb時自動更新索引行
rows:[{
"_id": "8ea64a80b67aff0ee12393b9",
"_rev": "3-3d76a4f82bc4d3f8f7",
"polines": [
{
"stock_enabled_flag": "Y",
"charge_account_id": 23397,
"line_type": "Material",
"make1": "make1",
"need_by_date": "2012/11/23",
"promised_date": "2012/11/23",
"quantity": 80,
"unit_of_measure": "BAG",
"unit_price": 161.00021
}
]
},
{
"_id": "8ea64a80b67aff0ee12393b99580",
"_rev": "3-3d76a4f82bc4d3f8f7",
"polines": [
{
"stock_enabled_flag": "Y",
"charge_account_id": 23397,
"line_type": "Material",
"make1": "make1",
"need_by_date": "2012/11/21",
"promised_date": "2012/11/21",
"quantity": 80,
"unit_of_measure": "BAG",
"unit_price": 171.00021
}
]
}
,{
"_id": "8ea64a80b67aff0ee12393b995",
"_rev": "3-3d76a4f82bc4d3f8f7",
"polines": [
{
"stock_enabled_flag": "Y",
"charge_account_id": 23397,
"line_type": "Material",
"make1": "make1",
"need_by_date": "2012/11/22",
"promised_date": "2012/11/22",
"quantity": 80,
"unit_of_measure": "BAG",
"unit_price": 181.00021
}
]
}]
這是我的數據CouchDB的數據。 我爲這個數據庫創建了索引。 然後我的要求是當我向couchdb添加一行時,它將使用nodejs在elasticsearch索引中更新。 預先感謝