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
ElasticSearch incorrecly serialize percolated queries #8003
Comments
My walkarround was to add the custom serializer |
Hi @KondzioSSJ4 ! I am having exactly the same problem but have trouble understanding how to add a custom serializer that supports union conversion correctly. Any chance you could share code, point to some documentation or just explain your solution in a bit more detail? Would be very grateful! Thanks in advance! |
Yes, sure Adding converter to context:
where most important is this method:
And converter is like:
The good idea would be adding such converter inside the repository to fix issue for other user of ElasticSearch |
Thanks @KondzioSSJ4 ! Now I understand a bit more! Have started adding more converters for other types that we need... |
So I decided to spend some time digging into that in order to solve. I found 2 serializers used in the client: By default requests are serialized with I guess nobody initially thought that percolate query feature will add internal types as part of the index/create request. Unfortunately, Possible resolutions: This requires owners decision here, so I can't provide a PR for now here as most likely it will be throw away work. Waiting for maintainers discussion and decision... |
Note: |
In case there are too many issues with serializer and percolate query item is simple and has query and id only you can keep separate instance of
This will allow to use same serializer for payload as for query in search, but you have to double check if payload serialized correctly. |
Hi there! After the big 8.13 release I finally have some time to look into the open issues 🙂 Another possible solution would be to expose a |
Elastic.Clients.Elasticsearch version: 8.11 (latest)
Elasticsearch version: 8.11.3 (latest)
.NET runtime version: 6
Operating system version: Windows 11
Description of the problem including expected versus actual behavior:
Percolated queries in Elastic Search doesn't serialized to correct value
For example simple query like:
when converted to percolated query in index it will provide:
What is incorrect, because it should converted to:
Steps to reproduce:
Go to repository:
https://bitbucket.org/KondzioSSJ4/es_percolatedserialization/src/meh/
And then just run any of this projects
each of them returns error when try to index data
Expected behavior
Percolated queries would correctly indexed in elastic
Provide
ConnectionSettings
(if relevant):localhost... any Docker would be helpfull
Provide
DebugInformation
(if relevant):The text was updated successfully, but these errors were encountered: