Keeping AWS CloudSearchDomain in sync with DynamoDB

北城以北 提交于 2020-01-05 08:18:17

问题


Im trying to add some flexible search functionality to my dynamoDB, so I set up the AWS CloudSearchDomain service. Which I believed could add a wrapper around my dynamoDB and retrieve documents with flexible search options.

Since implementing I realised that adding an item to my dynamoDB does not automatically add the item to the searchable CloudSearchDomain documents. The AWS docs advise to sync the DB items with the CloudSearchDomain periodically, such as at the end of each day. But I want my newly added items to be available for search as soon as its in the DB.

I also realise the documents that get returned from a CloudSearchDomain endpoint are not my plain json dynamoDB items. Each search result is wrapped in a 'hits' array, and all the property values are wrapped in arrays and its just a bit messy to handle on the front end. So is this the right tool for flexible searching the dynamodb. How are others using CloudSearchDomain with DynamoDB?

Im using the javascript sdk with node.js.

来源:https://stackoverflow.com/questions/44530846/keeping-aws-cloudsearchdomain-in-sync-with-dynamodb

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!