0
votes

Using the experimental Google Search API for App Engine and running locally:

search.Index(name=_INDEX_NAME).put(document_to_index)

This is exactly as per the Google documentation here: https://developers.google.com/appengine/docs/python/search/overview

But generates the following error:

AttributeError: 'Index' object has no attribute 'put'

Is this a bug or have I missed something?

2

2 Answers

2
votes

You need to update your SDK. add was deprecated in favor of put in release 1.7.3.

0
votes

It seems like the function has been re-named 'add'. This worked fine:

search.Index(name=_INDEX_NAME).add(document_to_index)