It seems that snippets don't work on the devserver. See the documentation: https://developers.google.com/appengine/docs/python/search/devserver
Using the Python Development Server
The Python development server runs on your local machine and emulates most of the Search API's capabilities. However, a few features are not currently available on the server. For the moment, you should not attempt to use the following features when you run on the development server:
Functions in expressions
These functions are not available:
- snippet()
- geopoint()
- distance()
- pow()
As advoretsky said, returned_expressions
needs to be an iterable. From the docs:
returned_expressions
An iterable of FieldExpression to evaluate and return in search results.
Further, be sure you import the right Query
and QueryOptions
, both are also found in google.appengine.ext.ndb
. I prefer to import them so they have a prefix, things are better readable then ;-)
from google.appengine.ext import ndb
from google.appengine.api import search
# Notice the nice distinction
ndb.Query
search.Query