Question: app engine search index & namespaces

35 views
Skip to first unread message

Dhanunjaya Naidu Yandrapu

unread,
Dec 12, 2017, 8:59:20 AM12/12/17
to Google App Engine

Hi,

I am writing a multi-tenant application using appengine namespaces. We need a separate index per tenant for searching employees (to avoid the 10GB limit of a search index). If I create a search index "employees" (in golang search.Open("employees") ) and index (in golang, search.Put(ctx, id, doc) ) the following documents
  1. doc1 from tenant 1 with namespace "abc" and 
  2. doc2 from tenant 2 with namespace "xyz". 
do those docs go into same index or two different indexes?

thanks,
dhanunjay

George (Cloud Platform Support)

unread,
Dec 12, 2017, 4:00:07 PM12/12/17
to Google App Engine
Search operations use the namespace associated with a context passed to them when they are called.

To perform an operation in a namespace, wrap a context with appengine.Namespace, and use that context when calling methods on an index. You may see an example in the "Using namespaces with Search" sub-chapter of the "Implementing Multitenancy Using Namespaces" online document

This is the usual way of performing operations in a namespace, and would require one index in your situation.  
Reply all
Reply to author
Forward
0 new messages