elasticsearch-grails-plugin icon indicating copy to clipboard operation
elasticsearch-grails-plugin copied to clipboard

Does java.sql.Clob supported in searchable Domain class field?

Open shineway opened this issue 11 years ago • 1 comments

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?

shineway avatar Mar 31 '13 13:03 shineway

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).

mstein avatar Apr 03 '13 09:04 mstein