com.google.appengine.api.search
Interface IndexManager


public interface IndexManager

A manager capable of listing available indexes, which can be queried about their metadata or have index/delete/search operations performed on them.

 IndexManager indexManager = IndexManagerFactory.newIndexManager();
 List<Index> indexes = indexManager.listIndexes();
 for (Index index : indexes) {
   index.getName();
   index.getNamespace();
   index.getConsistency();
   index.search("query");
 }
 
IndexManager is also responsible for creating new indexes
   IndexManager indexManager = IndexManagerFactory.newIndexManager();
   Index index = indexManager.getIndex(IndexSpec.newBuilder().setName("myindex"));
 


Method Summary
 Index getIndex(IndexSpec.Builder builder)
          Returns an instance of Index corresponding to the specification built from the given builder.
 Index getIndex(IndexSpec spec)
          Returns an instance of Index corresponding to the provided specification.
 java.lang.String getNamespace()
           
 ListIndexesResponse listIndexes(ListIndexesRequest request)
          Lists the indexes available.
 java.util.concurrent.Future<ListIndexesResponse> listIndexesAsync(ListIndexesRequest request)
          Lists the indexes available asynchronously.
 

Method Detail

getIndex

Index getIndex(IndexSpec spec)
Returns an instance of Index corresponding to the provided specification.

Returns:
an instance of Index corresponding to the given spec

getIndex

Index getIndex(IndexSpec.Builder builder)
Returns an instance of Index corresponding to the specification built from the given builder.

Returns:
an instance of Index corresponding to the given spec

getNamespace

java.lang.String getNamespace()
Returns:
the namespace associated with this index manager

listIndexes

ListIndexesResponse listIndexes(ListIndexesRequest request)
Lists the indexes available.

Parameters:
request - a request specifying which indexes to list
Returns:
a ListIndexesResponse containing list of existing indexes
Throws:
ListIndexesException - if there is a failure in the search service listing indexes

listIndexesAsync

java.util.concurrent.Future<ListIndexesResponse> listIndexesAsync(ListIndexesRequest request)
Lists the indexes available asynchronously.

Parameters:
request - a request specifying which indexes to list
Returns:
a Future that will allow getting a ListIndexesResponse containing a list of existing indexes