-
Notifications
You must be signed in to change notification settings - Fork 25.1k
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
Problem when using metadata of type DateTime with other metadata #84655
Comments
I think this is just how Elasticsearch works. When Elasticsearch first sees a field it takes a guess about what type it should have. I'm not sure about what you are doing exactly, but it sure looks like this. This really is more of a "how do I use Elasticsearch?" question than a bug. Probably obscured by some other software. I'm guessing you should take up your problem with them. If you have other questions about Elasticsearch though you should probably open them at https://discuss.elastic.co/ |
The cygnus component sends the following to elasticsearch: fiware-cygnus | time=2022-03-16T16:00:29.874Z | lvl=INFO | corr=175d81b1-d93b-402b-9ffc-5171dc3cabf2 | trans=175d81b1-d93b-402b-9ffc-5171dc3cabf2 | srv=N/A | subsrv=N/A | comp=cygnus-ngsi | op=run | msg=com.telefonica.iot.cygnus.sinks.NGSIElasticsearchSink$1[111] : [elasticsearch-sink] Persisting data at NGSIElasticsearchSink. (index=cygnus-fiware-service--urn-ngsi-ld-room-room3070-room-2022.03.16, type=cygnus_type, data=[{data={"recvTime":"2022-03-16T16:00:29.054+0000","entityType":"Room","attrMetadata":[],"entityId":"urn:ngsi-ld:Room:Room3070","attrValue":"21","attrName":"temperature","attrType":"Number"}, recvTimeTs=1647446429054}, {data={"recvTime":"2022-03-16T16:00:29.054+0000","entityType":"Room","attrMetadata":[{"name":"amountOfThisGood","type":"Text","value":"1"},{"name":"timestamp","type":"DateTime","value":"2022-03-15T23:00:00.000Z"}],"entityId":"urn:ngsi-ld:Room:Room3070","attrValue":"803","attrName":"pressure","attrType":"Number"}, recvTimeTs=1647446429054}]) And in ElasticSearch component I obtain: db-elasticsearch | {"type": "server", "timestamp": "2022-03-16T16:00:29,784Z", "level": "DEBUG", "component": "o.e.c.c.C.CoordinatorPublication", "cluster.name": "docker-cluster", "node.name": "elasticsearch", "message": "publication ended successfully: Publication{term=1, version=22}", "cluster.uuid": "LfRZ0XnjRpe5L3H1XZYQpQ", "node.id": "F4TG9aAHRqCMAWafV3DtDw" } |
Elasticsearch Version
7.6.2
Installed Plugins
No response
Java Version
16.0.1
OS Version
5.13.0-30-generic #33~20.04.1-Ubuntu
Problem Description
Working in an integration between the context broker Orion-LD, FIWARE CYGNUS and elasticsearch, when I am creating an entity which has two or more metadata of different type (for example, Text or Number) works fine, but when creating an entity with one metadata with type DateTime, if there are more metadata on the same attribute the insertion fails and the attribute is not stored on the database.
Steps to Reproduce
This entity is stored correctly
While this other entity creation fails
Logs (if relevant)
The text was updated successfully, but these errors were encountered: