Book Image

Mastering Google App Engine

Book Image

Mastering Google App Engine

Overview of this book

Table of Contents (18 chapters)
Mastering Google App Engine
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Indexing your data


Now that we understand some of the background about searches and how the indexing works, it is time to index some of our own data. In the case of developing applications on top of Google App Engine, our source of data to be indexed would most likely be datastore. In this section, we will first generate some sample data with interesting characteristics and next we will see how we can index that data using the App Engine's search API.

Sample data

We have being using our Listing class for a while now for modeling a classified website. This time around, we are more focused towards real estate and hence some relevant attributes are added. Here's how our model class looks like this time:

class Listing(ndb.Model): 
    title = ndb.StringProperty(required=True) 
    ref_no = ndb.StringProperty(required=True) 
    beds = ndb.IntegerProperty(required=True) 
    size = ndb.IntegerProperty(required=True) 
    price = ndb.IntegerProperty(required=True) 
    location = ndb.GeoPtProperty...