Search is a feature widely required by Google App Engine. in fact, the latest Gae SDK already provides search APIs, probably because they are not yet mature and have not yet been made public. however, some traces can be found in the Gae document.
The example in the official Google App Engine documentation uploading data with bulk data Uploader demonstrates how to add the search function:
First, set entity to searchable:
Def handleentity (self, entity ):
Ent = search. searchableentity (entity)
Return ent
Next, you can search the entity:
Query = search. searchablequery ('person ')
Query. Search (keyword)
For result in query. Run ():
Self. response. Out. Write ('% s' % result ['email'])
As you can see,CodeGoogle. appengine. ext. search. the downloaded SDK has the Gae source code. We can take the code to check whether: C: \ Program Files \ google \ google_appengine \ google \ appengine \ ext \ Search \ __init __. PY (this is the path on my machine, and the path you install may be different)
\ Search \__ init _. py has three classes:
Searchableentity
Searchablequery
Searchablemodel
Searchablemodel is a subclass of DB. model. To use searchablemodel, your model must be inherited from searchablemodel, rather than DB. model. You can use the query method to search:
Query = article. All (). Search ("sausages cheese dogs ")
App Engine guy explains how to use searchablemodel in the blog
The current search API is still very simple. It only supports exact matching, no phrases, no syntax changes, and does not support adding stop words by yourself. google should gradually enhance this function in the next releases. After all, search is Google's strength and it cannot be imagined that gogole's web hosting platform does not support search. let's wait and see.
My Google App Engine essays:
Full-text search API of Google App Engine
Restrictions on databases (datastore) in Google App Engine