我有如下所示的域类
class Post {
String title
String body
//common
Date dateCreated
Date lastUpdated
//Mappings
static belongsTo = [user:User]
static hasMany = [comments:Comment,tags:TagBlog]
static mapping = {
body type:"text"
}
static constraints = {
title nullable:false,blank:false
body nullable: false, blank:false
}
static searchable = {
except = 'user'
}
}
和
class Comment {
String comment
int vote
//common
Date dateCreated
Date lastUpdated
static belongsTo = [post:Post,user:User]
static mapping = { comment type:"text" }
static constraints = {
comment nullable:false,blank:false
vote nullable:true,blank:true
}
static searchable = {
except = 'user'
}
}
以下是我得到的错误
| Error 2013-05-30 00:08:15,583 [elasticsearch[index]-pool-6-thread-2] ERROR index.IndexRequestQueue - Failed bulk item: MapperParsingException[object mapping for [comment] tried to parse as object, but got EOF, has a concrete value been provided to it?]
我浏览了互联网上的许多帖子,但我无法解决这个问题!到目前为止,我的猜测是,这可能是由于我的两个变量与映射type:"Text"
任何帮助将不胜感激。
到目前为止,我正在使用以下存储库
mavenRepo "https://oss.sonatype.org/content/repositories/snapshots/"
mavenRepo 'https://repo.springsource.org/libs-snapshot/'
mavenRepo "http://maven.springframework.org/milestone/"
以下是我为 ES 打开它后得到的调试信息
2013-05-30 18:26:11,157 [localhost-startStop-1] DEBUG mapping.SearchableClassMappingConfigurator - Retrieved index settings
2013-05-30 18:26:11,158 [localhost-startStop-1] DEBUG mapping.SearchableClassMappingConfigurator - Installing mappings...
2013-05-30 18:26:11,163 [localhost-startStop-1] DEBUG mapping.SearchableClassMappingConfigurator - Index com.ecw.wellness does not exists, initiating creation...
2013-05-30 18:26:11,163 [localhost-startStop-1] DEBUG mapping.SearchableClassMappingConfigurator - Waiting at least yellow status on com.ecw.wellness ...
2013-05-30 18:28:07,884 [localhost-startStop-1] DEBUG mapping.SearchableClassMappingConfigurator - Index com.ecw.wellness already exists, skip index creation.
2013-05-30 18:28:07,885 [localhost-startStop-1] DEBUG mapping.SearchableClassMappingConfigurator - [com.ecw.wellness.answer] => {com.ecw.wellness.answer={properties={answer={type=string, include_in_all=true, term_vector=with_positions_offsets}, votes={type=object}, dateCreated={type=date, include_in_all=true}, lastUpdated={type=date, include_in_all=true}, question={type=object}}}}
2013-05-30 18:34:13,817 [localhost-startStop-1] DEBUG mapping.SearchableClassMappingConfigurator - Index com.ecw.wellness does not exists, initiating creation...
2013-05-30 18:34:13,818 [localhost-startStop-1] DEBUG mapping.SearchableClassMappingConfigurator - Waiting at least yellow status on com.ecw.wellness ...