typesense-java icon indicating copy to clipboard operation
typesense-java copied to clipboard

Add and retrieve metadata section of Collection Model definition (on creation or fetch)

Open danipenaperez opened this issue 1 year ago • 0 comments

Description

On collection create action, via API you be able to send metadata, but typesense-java-sdk does not support this field.

Steps to reproduce

Offical Docs at https://typesense.org/docs/27.1/api/collections.html#adding-metadata-to-schema.

Expected Behavior

That CollectionSchema.java has new field "metadata" with signature similar to:

collectionschema.setMetaData(Map<String,Object> metadata);

The user be able to use in this way:

var metadata = new HashMap<String,Object>(); metadata.put("batch_job", 325); metadata.put("indexed_from", "2023-04-20T00:00:00.000Z") collectionSchema.setMetadata(metadata;

client.collections().create(collectionSchema); //Will create collection adding metadata

Actual Behavior

It's not supported.

Metadata

Typesense Version JAVA: v1.0.0

OS:

Would be great to fetch metadata info using client.collections("products").retrieve().getMetadata();

danipenaperez avatar Jan 16 '25 08:01 danipenaperez