elasticsearch,Grails,Groovy,elasticsearch" /> elasticsearch,Grails,Groovy,elasticsearch" />

Grails elasticsearch插件,带有;“文本”;映射

Grails elasticsearch插件,带有;“文本”;映射,grails,groovy,elasticsearch,Grails,Groovy,elasticsearch,我有如下的域类 class Post { String title String body //common Date dateCreated Date lastUpdated //Mappings static belongsTo = [user:User] static hasMany = [comments:Comment,tags:TagBlog] static mapping = { bo

我有如下的域类

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'

    }

}

下面是我得到的错误

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

编辑

我发现了最初的bug:ES中的插件将原始类型(即注释域中的
int-vote
属性)映射为“object”,但该属性没有序列化为对象,因此ES不知道如何处理它。将投票属性键入为
整数投票
将使其工作。 我已经在github存储库中提交了一个问题:

原始答案(增强):

您使用的插件版本是什么?是来自grails存储库还是直接来自github存储库? 无论如何,你能试着拉一下这个插件的0.20.6.1-SNAPSHOT版本吗?它刚刚神奇地出现在grails中央存储库中

runtime ":elasticsearch:0.20.6.1-SNAPSHOT"
注意:如果您没有使用
本地
模式并且运行自己的ElasticSearch实例,请尝试匹配grails插件的版本号:
0.20.6


此外,如果插件在使用
节点
模式启动期间挂起,则可能意味着它无法自动发现ES群集。在这种情况下,请尝试使用
传输
模式。仅供参考,grails ES插件默认情况下将使用地址
localhost:9300
,但这是可配置的(请参阅插件文档)。

I最初使用的是“运行时”:elasticsearch:0.17.8.1”。在我尝试使用20.6.0快照后,我的服务器挂起在“运行Grails应用程序”上,从未向前移动过。我编辑了原始问题并添加了当前的maven repos。我使用Grails安装插件命令再次安装了它,但在过去20分钟里它仍然停留在“运行Grails应用程序”消息上!您使用的是默认配置(本地节点)还是外部弹性搜索实例?如果是本地节点,您可能需要重置(删除)ES节点的数据文件夹并重新编制索引,因为0.20.6-SNAPSHOT可能在使用的映射中存在一些差异。对不起,我从昨晚开始使用elasticsearch,我删除了文件夹“elasticsearchhome/data”的内容,对吗?当我们在运行时,如果我想在“节点”模式下运行它,我必须从终端运行弹性搜索吗?我很抱歉在一个问题中提出这个问题,但我非常感谢你的回答
runtime ":elasticsearch:0.20.6.1-SNAPSHOT"