diff --git a/examples/README.md b/examples/README.md index c2d951b9f..942abda15 100644 --- a/examples/README.md +++ b/examples/README.md @@ -1904,8 +1904,8 @@ Cloudant service = Cloudant.newInstance(); // Type "text" index fields require an object with a name and type properties for the field. IndexField field = new IndexField.Builder() - .add("name", "address") - .add("type", "string") + .name("address") + .type(IndexField.Type.STRING) .build(); IndexDefinition indexDefinition = new IndexDefinition.Builder() diff --git a/examples/snippets/postIndex/example_request_using_text_type_index.java b/examples/snippets/postIndex/example_request_using_text_type_index.java index 5dc4af9cc..21df8fefe 100644 --- a/examples/snippets/postIndex/example_request_using_text_type_index.java +++ b/examples/snippets/postIndex/example_request_using_text_type_index.java @@ -9,8 +9,8 @@ // Type "text" index fields require an object with a name and type properties for the field. IndexField field = new IndexField.Builder() - .add("name", "address") - .add("type", "string") + .name("address") + .type(IndexField.Type.STRING) .build(); IndexDefinition indexDefinition = new IndexDefinition.Builder()