New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Current token (VALUE_NUMBER_INT) not of boolean type #1435

Closed
silasrm opened this Issue Jan 10, 2018 · 5 comments

Comments

Projects
None yet
3 participants
@silasrm
Copy link

silasrm commented Jan 10, 2018

Please see FriendsOfSymfony/FOSElasticaBundle#1382

Version: 6.0.0
ES version: 6.1.1
PHP version: 7.1

@silasrm silasrm changed the title Error when update field mapped as boolean on Doctrine Current token (VALUE_NUMBER_INT) not of boolean type Jan 10, 2018

@ruflin

This comment has been minimized.

Copy link
Owner

ruflin commented Jan 12, 2018

TBH I don't think I fully understand (yet) what is going and if this is a Doctrine or an Elastica issue. Could you share some details on why you thinks it's an Elastica issue?

@silasrm

This comment has been minimized.

Copy link
Author

silasrm commented Jan 15, 2018

The message error is from ElasticSearch, see java style package name: org.elasticsearch.transport.netty4.ByteBufStreamInput@1d349bde.

Elastica is responsable for sent data/requests to ElasticSearch. Because of this, I think this error is in process of the convertion from doctrine Entity to Elastica, and this is sent to ElasticSearch and cause this error. But, I don't how to debug this.

Or I'm fully wrong. Sorry if it looks like I want to blame it on Elastica.

@silvioq

This comment has been minimized.

Copy link
Contributor

silvioq commented Jan 18, 2018

I have the same error. I think the trouble is in bulk update, the parameter is "doc_as_upsert: 1" and must be "doc_as_upsert: true"

https://github.com/ruflin/Elastica/blob/master/lib/Elastica/Bulk/Action.php#L208

I'm using Fos/FOSElasticaBundle too

@silasrm

This comment has been minimized.

Copy link
Author

silasrm commented Jan 18, 2018

Great @silvioq

@silvioq

This comment has been minimized.

Copy link
Contributor

silvioq commented Jan 18, 2018

I changed that line for

                if (isset($source['doc_as_upsert'])) {
                    $docAsUpsert = ', "doc_as_upsert": ' . ($source['doc_as_upsert'] ? 'true' : 'false' );
                } else {
                    $docAsUpsert = '';
                }

... this works as expected!

@ruflin ruflin closed this in #1442 Jan 31, 2018

ruflin added a commit that referenced this issue Jan 31, 2018

huebs added a commit to AdvisorPerspectives/Elastica that referenced this issue Mar 20, 2018

ruflin added a commit that referenced this issue Mar 21, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment