java-client
java-client copied to clipboard
[Question] - ModuleConfig
Hi,
I'm trying to port the python example to java. https://github.com/semi-technologies/weaviate-examples/blob/34bb73f8d2096e04aaf19455f2f8da743f21b8d5/attendance-system-example/student_add.py#L32
However I'm missing some documentation on how to create the following ModuleConfig.
"moduleConfig": {
"img2vec-neural": {
"imageFields": [
"image"
]
}
},
Any idea how I should go about this?
Regards,
p.s. I receive the following error:
module 'img2vec-neural': imageFields not present
after I have added the following code to the schema:
.vectorIndexType("hnsw")
.vectorizer("img2vec-neural")
The following works. It would be nice if this was more type-safe and using the builder pattern.
var moduleConfigFields = new HashMap<String, String[]>();
moduleConfigFields.put("imageFields", new String[]{ "your-image-field" });
var moduleConfig = new HashMap<String, Object>();
moduleConfig.put("img2vec-neural", moduleConfigFields);
var schemaClass = WeaviateClass.builder()
.ModuleConfig(moduleConfig)
// your schema
.build()