Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-apps-script/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
<img src="//i.stack.imgur.com/RUiNP.png" height="16" width="18" alt="" class="sponsor tag img">elasticsearch 无法在弹性搜索中整理域实例[demo.Category:7]_<img Src="//i.stack.imgur.com/RUiNP.png" Height="16" Width="18" Alt="" Class="sponsor Tag Img">elasticsearch_Grails_Indexing - Fatal编程技术网 elasticsearch 无法在弹性搜索中整理域实例[demo.Category:7],elasticsearch,grails,indexing,elasticsearch,Grails,Indexing" /> elasticsearch 无法在弹性搜索中整理域实例[demo.Category:7],elasticsearch,grails,indexing,elasticsearch,Grails,Indexing" />

elasticsearch 无法在弹性搜索中整理域实例[demo.Category:7]

elasticsearch 无法在弹性搜索中整理域实例[demo.Category:7],elasticsearch,grails,indexing,elasticsearch,Grails,Indexing,我已经在Grails3.3.6中实现了弹性搜索。我运行了一个应用程序,在id为7的类别上建立了错误索引 我的分类域是 class Category { static hasMany = [events : Event] Category parent String name String description User createdBy User modifiedBy Timestamp createdDate Timestamp modifiedDate def beforeInser

我已经在Grails3.3.6中实现了弹性搜索。我运行了一个应用程序,在id为7的类别上建立了错误索引

我的分类域是

class Category {

static hasMany = [events : Event]
Category parent
String name
String description
User createdBy
User modifiedBy
Timestamp createdDate
Timestamp modifiedDate

def beforeInsert(){
    createdDate = new Timestamp(new Date().getTime())
    modifiedDate = new Timestamp(new Date().getTime())
}
def beforeUpdate() {
    modifiedDate = new Timestamp(new Date().getTime())
}

static constraints = {
    name nullable: false , unique: true
    description nullable: true
    parent nullable: true
    createdBy nullable: false
    modifiedBy nullable: false
    createdDate nullable: true
    modifiedDate nullable: true
    events nullable: true
}
static searchable = true

}
package com.grailsbrains
我的事件域是

class Category {

static hasMany = [events : Event]
Category parent
String name
String description
User createdBy
User modifiedBy
Timestamp createdDate
Timestamp modifiedDate

def beforeInsert(){
    createdDate = new Timestamp(new Date().getTime())
    modifiedDate = new Timestamp(new Date().getTime())
}
def beforeUpdate() {
    modifiedDate = new Timestamp(new Date().getTime())
}

static constraints = {
    name nullable: false , unique: true
    description nullable: true
    parent nullable: true
    createdBy nullable: false
    modifiedBy nullable: false
    createdDate nullable: true
    modifiedDate nullable: true
    events nullable: true
}
static searchable = true

}
package com.grailsbrains
导入com.grailsbrains.auth.User

导入java.sql.Timestamp

班级活动{

static belongsTo = [category : Category, organization: Organization]
static hasMany = [languages : Language,formats:Format]

String title
String duration
String type
String summary
String prequel
byte[] mainVideo
byte[] mainImage
String tagline
String specialInstruction
String mapUrl
Timestamp startDateTime
Timestamp endDateTime
boolean isEnabled
boolean isExpired
String accessType
String entrance
User createdBy
User modifiedBy
Timestamp createdDate
Timestamp modifiedDate

def beforeInsert(){
    createdDate = new Timestamp(new Date().getTime())
    modifiedDate = new Timestamp(new Date().getTime())
}
def beforeUpdate() {
    modifiedDate = new Timestamp(new Date().getTime())
}

static searchable = {
    title boost: 2.0
    summary boost: 1.0
    title analyzer: 'simple'
    summary analyzer: 'simple'
    tagline analyzer: 'simple'
    category reference : true
    formats reference: true
    languages reference: true
    except = ['mainImage','mainVideo','createdBy','modifiedBy','createdDate','modifiedDate']
}

static constraints = {
    title nullable: true , unique: true
    startDateTime nullable: true
    endDateTime nullable: true
    mainImage nullable: true
    mainVideo nullable: true
    duration nullable: true
    type nullable: true, blank:false
    summary nullable: true , blank:false
    prequel nullable: true 
    tagline nullable: true 
    specialInstruction nullable: true 
    mapUrl nullable: true 
    isExpired nullable: false
    isEnabled nullable: false
    accessType nullable: true
    entrance nullable: true
    createdBy nullable: true
    modifiedBy nullable: true
    createdDate nullable: true
    modifiedDate nullable: true

}
}
我试图通过postman使用API将值插入类别表中。数据已插入表中。但我遇到此错误

2018-07-31 14:20:15.337错误---[main] g、 p.e.index.IndexRequestQueue:错误索引类 com.grailsbrains.Category(索引:com.grailsbrains\u write,类型: 第7号身份证(类别) grails.plugins.elasticsearch.exception.IndexException:未能 marshall域实例[com.grailsbrains.Category:7]位于 sun.reflect.NativeConstructorAccessorImpl.newInstance0(本机方法) 在 sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) 在 sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) 位于java.lang.reflect.Constructor.newInstance(Constructor.java:408)

在我的控制台里。有什么想法吗?有人能帮我吗


提前感谢。

您的ES服务器日志中有错误吗?在grails控制台中,我发现了这个错误-“未能整理域实例[com.grailsbrains.Category:7]”。在哪里可以找到ES日志?这取决于您是如何安装的。使用tarball或zip文件或通过软件包管理器?我已使用ElasticSearch日志进行了检查-没有错误。您正在运行哪个版本的ES以及哪个版本的grails ElasticSearch插件?