typesense / typesense-java

Java client for Typesense
https://typesense.org/docs/latest/api/
Apache License 2.0
59 stars 29 forks source link

Please add an enum with the field types to prevent typing errors #17

Closed tropikoder closed 2 years ago

tropikoder commented 2 years ago

Description

ArrayList<Field> fields = new ArrayList<>();
fields.add(new Field().name("countryName").type("string"));
fields.add(new Field().name("capital").type("string"));
fields.add(new Field().name("gdp").type("int32").facet(true));

It's too easy to mis-type one of those strings in the type field. It would also be easy to provide an enum with the right.

Steps to reproduce

Expected Behavior

Actual Behavior

Metadata

Typsense Version:

OS:

tropikoder commented 2 years ago

nevermind i see you have it just that the README is out-of date