Java – connect appengine datastore and Search API

I don't know what's the best way to connect to the data store and Search API?

What I am looking for is that whenever I create an entity (such as a product), the product will be added to the search index When updating, the index should also be updated. When deleting products, your guess is correct - products should be deleted from the search index

When searching for products, I want to do a full-text search on the product index instead of documents that need real entities Maybe I need to search using the index first, and then call the data store again?

What worries me most is to keep the data storage and search index synchronized Of course, you can also search the index. The data storage area will not only be troublesome, but also I think it may cause pain in paging

I want to know if someone has "connected" to the data store and searched the API in this way, and the results may also be some best practices The App Engine document doesn't say much about this

Solution

In order to use the Search API, you need to define searchable data as a document, and then use the index class to construct it as an index Therefore, for the time being, you need to operate exactly as you described. Please keep searchable documents synchronized with data storage entities

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>