Skip to content
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
Closed

Current token (VALUE_NUMBER_INT) not of boolean type #1435

silasrm opened this issue Jan 10, 2018 · 5 comments

Comments

@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
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
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
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
Copy link
Author

silasrm commented Jan 18, 2018

Great @silvioq

@silvioq
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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants