Search API on Datastore with frequently changing data
Datastore entities have the following fields:
I want to be able to perform a Full-text search on name and description. In order to do this we need to create Google Search Api documents from the Datastore entities.
However, the datastore data has the following attributes:
The biggest issue I have is preventing to have Google API documents that reference Datastore entities that do not exist anymore. (Not exist as in the not_unique_id does not appear in the Datastore anymore)
I would like to see some concepts, guideliness, ideas and tips so I can verify I'm on the right way. Thanks!!
Solution in progress:
Below is the routine to keep the Search API in sync with the Datastore. CreateUpdateDelete are executed on user request. Read is executed on App request. The Cron job will use Delete to keep the Search API in sync with the Datastore.
Datastore Entities
id = user_id
ancestor = not_unique_id
| ancestor | id | created | name | description | number |
| 19385020 | 1 | 1234567 | Foo | Qwerty | 63 |
| 19385020 | 2 | 1234567 | Foo | Qwerty2 | 12 |
| 19385020 | 3 | 1234567 | Foo | Qwerty | 74 |
Search API Documents
| not_unique_id | name | description |
| 19385020 | Foo | Qwerty |
Create
Read
Update
Delete
Cron
Fetch all Entities where number == 0 or created < 12 hours ago. Remove Document if last decendant Entity is about to be removed. Remove Entity.
链接地址: http://www.djcxy.com/p/23222.html上一篇: Google App Engine(Python)减慢祖先查询
下一篇: 使用频繁更改的数据在数据存储上搜索API