elasticsearch-grails-plugin
elasticsearch-grails-plugin copied to clipboard
Does java.sql.Clob supported in searchable Domain class field?
import java.sql.Clob
Class A { String f1 Clob fClob
static searchable = {
only = ['f1', ' fClob']
}
}
when indexing, got following error:
[elasticsearch[Fontanelle][bulk][T#7]] ERROR index.IndexRequestQueue - Failed bulk item: MapperParsingException[object mapping for [es.A] tried to parse as object, but got EOF, has a concrete value been provided to it?]
any suggestion?
The plugin does not provide native support for Clob object, and I don't know if ElasticSearch itself has a default mapping for this type. When the type is unknown, it is just parsed and sent to ES as a plain object, which may not work as you expect.
You may have to convert it into a String field using a converter.
static searchable = {
fClob converter:FClobConverter
}
With FClobConverter
being an implementation of java.beans.PropertyEditorSupport
(simple implementation example there : https://github.com/mstein/elasticsearch-grails-plugin/blob/master/grails-app/utils/test/RoleConverter.groovy).