mstein / elasticsearch-grails-plugin

ElasticSearch grails plugin
Based on Graeme Rocher initial stub. Note that it is still in early stage.
Other
62 stars 164 forks source link

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

Open shineway opened 11 years ago

shineway commented 11 years ago

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?

mstein commented 11 years ago

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