Notice: Over the next few months, we're reorganizing the App Engine documentation site to make it easier to find content and better align with the rest of Google Cloud products. The same content will be available, but the navigation will now match the rest of the Cloud products.

Schema (Google App Engine API for Java)

Stay organized with collections Save and categorize content based on your preferences.

Class Schema

  • java.lang.Object

  • public final class Schema
    extends java.lang.Object
    Contains information about the kinds of document Fields which are supported by the Index.

       // Get the searchService for the default namespace
       SearchService searchService = SearchServiceFactory.getSearchService();
       // Get the first page of indexes available and retrieve schemas
       GetResponse<Index> response = searchService.getIndexes(
       // List out elements of Schema
       for (Index index : response) {
         Schema schema = index.getSchema();
         for (String fieldName : schema.getFieldNames()) {
            List<FieldType> typesForField = schema.getFieldTypes(fieldName);

    • Method Detail

      • getFieldNames

        public java.util.Set<java.lang.String> getFieldNames()
        the set of field names supported in the schema
      • getFieldTypes

        public java.util.List<Field.FieldType> getFieldTypes(java.lang.String fieldName)
        fieldName - the name of the field to return supported types
        a list of Field.FieldType supported for the given field name. The returned list will be empty if the schema has no field with the given name.
      • toString

        public java.lang.String toString()
        toString in class java.lang.Object
      • hashCode

        public int hashCode()
        hashCode in class java.lang.Object
      • equals

        public boolean equals(java.lang.Object obj)
        equals in class java.lang.Object
      • newBuilder

        public static Schema.Builder newBuilder()
        Creates a schema builder.
        a new builder for creating a schema