GAE Search API - Python

302 views
Skip to first unread message

Raphaël Antonmattei

unread,
Sep 7, 2018, 1:14:07 PM9/7/18
to google-a...@googlegroups.com
Hi,

We're having some trouble working with the Python API to index documents into the Search in App Engine.

we have to do it like shown below
from google.appengine.api import search
index
= search.Index(name='productsearch1')
The problem is the google.appengine.api package does not exist... (ModuleNotFoundError: No module named 'google.appengine'). SO, ther eis obviously a missing dependency. After a few minutes of Googling, we found this library which looks unofficial and does not seem supported anymore (last commit from Jan 2015).

Then, that one https://developers.google.com/api-client-library/python/reference/pydoc which does not have any AppEngine API.

Surprisingly, there is nothing about App Engine nor Search...

With all these resources, we were not able to follow the example shown on the AppEngine Search documentation. Moreover the doc page mentioned above (with code samples) is from 2012...

Thus the questions below. 
  • How can we move forward on this and index our documents in Search using Python?

  • Additionally, is there any refactoring going on with the various (too many) Python APIs? This is VERY confusing.

  • Is there any search related products in the pipe? Surprisingly the Search in AppEngine looks like the only option as a managed search product and does not seem central in the offering... (🤔 odd for a Search company like Google) whereas there are other competitors on the market (AWS CloudSearch, SwifType, Algolia, Elastic Cloud...)

Thanks in advance for your help, greatly appreciated!
Raphael



--
  
Raphaël Antonmattei
VP of Engineering

 +33 7 84 48 47 22
      rap...@pathmotion.com
      Paris • London • New York
      pathmotion.com LinkedIn • PathMotion Profile • Twitter

Juan Luis

unread,
Sep 7, 2018, 1:41:48 PM9/7/18
to Google App Engine
Hi Raphaël

Are you deploying your app to Standard Environment? You can only use (and will only find google.appengine.api) in Standard env. If you are deploying to flexible environment you will not find appengine API, It's a more general environment where you can use standard Python google libraries as it were in your local development env.

Hope it helps...Juan Luis

Vitaly Bogomolov

unread,
Sep 7, 2018, 3:32:50 PM9/7/18
to Google App Engine
Hi Raphaël


from google.appengine.api import search
index
= search.Index(name='productsearch1')
The problem is the google.appengine.api package does not exist... (ModuleNotFoundError: No module named 'google.appengine').

GAE Search API can be accessed in several contexts of  Standard Environment

1. Production environment. Try to deploy this code to GAE, it will be work as expected.

Search API will be available with some restrictions: https://cloud.google.com/appengine/docs/standard/python/search/devserver

3. Local unit tests. You need some additional settings as described here: https://cloud.google.com/appengine/docs/standard/python/tools/localunittesting
BTW, you can use my helper class for this purpose (just inherit your test cases from this class): https://github.com/vb64/test.helper.gae

WBR, Vitaly.

Attila-Mihaly Balazs

unread,
Sep 10, 2018, 7:28:03 AM9/10/18
to Google App Engine
Expanding on Vitaly's first point: Search is available in the AppEngine Standard environment with the "first generation" runtimes (ie. with Python 2.7 but not with Python 3.7).

Attila

Katayoon (Cloud Platform Support)

unread,
Sep 11, 2018, 2:33:25 PM9/11/18
to Google App Engine

Hi,


I should add that here you can find all App Engine Python APIs available for Standard environment (meaning that they are already available on the platform and no need to install them) and here you can find all the external Google Cloud Client Libraries for Python which should be installed before being used.


  • Note that Python 3.7 is in beta stage at the moment and App Engine product team are progressively evolving the original App Engine APIs to make them accessible across all GCP platforms, however you may send your feature request via the Issue Tracker to let the product team know your interest/concern.

Tony Indrali

unread,
May 6, 2019, 9:09:23 AM5/6/19
to Google App Engine
Hi,

To make it very clear, the original App Engine APIs, specifically the Search API (https://cloud.google.com/appengine/training/fts_intro/), is planned to be made available to Python 3.7 standard environment App Engine?

Thanks in advance.

Harmit Rishi (Cloud Platform Support)

unread,
May 15, 2019, 11:21:17 PM5/15/19
to google-a...@googlegroups.com
Hi, 

Thank you for using Google Groups!

At the moment there is no clear indication of the implementation of this API for GAE. However, I went ahead and filed a feature request for this to the appropriate engineering team for the Python3.7 functionality. You may track the progress of it here. All further updates regarding this feature request will occur there.

I hope this helps! 
Reply all
Reply to author
Forward
0 new messages