mapping set to strict, dynamic introduction of [members] within

Description

i found out at ElasticsearchIndexWorkVisitor class line 213 is causing the issue above while indexing datas; i modify "Index index = new Index.Builder( source )" to "Index index = new Index.Builder( source.toString() )" that everthing is working fine, so i just temporarily fix this by overriding ElasticsearchIndexWorkVisitor class in my project; if this is a problem so i just wanna tell your communnity.

Environment

GSON 2.2.2/Jest 2.0.4/Elasticsearch 2.4.2

Activity

Show:
Yoann Rodière
June 7, 2017, 7:06 AM

Thank you for your report. I'm not sure what the problem is exactly, though. If an exception was thrown, could you please post the stack trace? Ideally, could you also post the code of the entity causing the issue?

Cary.yu
June 9, 2017, 2:27 AM

I guess the problem is Jest incompatible with Gson JsonObject, because there is members property , Jest will build the es data structure below when the source paramerter in Index.Builder constructor is an JsonObject,
--------------------------------------------------------------------------------------------------------------------------------
{
members: [{
id: 1
}]
}

--------------------------------------------------------------------------------------------------------------------------------
Instead of
{
id: 1
}

Yoann Rodière
June 9, 2017, 2:18 PM

Jest uses Gson, it's not an incompatibility. However, I see you're using Gson 2.2.2, while Hibernate Search 5.6.2.Final (and Jest 2.0.4) are designed to use Gson 2.6.2. Your setup is unlikely to work correctly.

I suggest you check your dependencies and your classpath: your application should use Gson 2.6.2 and only this version (you shouldn't have both 2.2.2 and 2.6.2 in your classpath).
Please tell me if this solves your problem, so I can close this ticket.

Cary.yu
June 12, 2017, 7:21 AM

Yeah you're right, after i make an exclusion in pom.xml of Gson 2.2.2 which the one dependency related to, then 2.6.2 that automatically shows out, and the problem is no longer exist, really thanks.

Yoann Rodière
June 12, 2017, 7:24 AM

Glad to be of help. Don't hesitate to use stackoverflow with the hibernate-search tag for help: we also monitor questions there.

Closing this ticket.

Assignee

Yoann Rodière

Reporter

Cary.yu

Labels

None

Suitable for new contributors

None

Pull Request

None

Feedback Requested

None

Components

Affects versions

Priority

Major
Configure