public final class Schema
extends java.lang.Object
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 GetResponseresponse = searchService.getIndexes( GetIndexesRequest.newBuilder().setSchemaFetched(true).build()); // List out elements of Schema for (Index index : response) { Schema schema = index.getSchema(); for (String fieldName : schema.getFieldNames()) { List typesForField = schema.getFieldTypes(fieldName); } }
Modifier and Type | Class and Description |
---|---|
static class |
Schema.Builder
A builder which constructs Schema objects.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
java.util.Set<java.lang.String> |
getFieldNames() |
java.util.List<Field.FieldType> |
getFieldTypes(java.lang.String fieldName) |
int |
hashCode() |
static Schema.Builder |
newBuilder()
Creates a schema builder.
|
java.lang.String |
toString() |
public java.util.Set<java.lang.String> getFieldNames()
public java.util.List<Field.FieldType> getFieldTypes(java.lang.String fieldName)
fieldName
- the name of the field to return supported typesField.FieldType
supported for the given field
name. The returned list will be empty if the schema has no field with the given name.public java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public static Schema.Builder newBuilder()