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

Add support for sub fields of objects fields #237

Open
alexgarel opened this issue Aug 22, 2024 · 1 comment
Open

Add support for sub fields of objects fields #237

alexgarel opened this issue Aug 22, 2024 · 1 comment
Labels

Comments

@alexgarel
Copy link
Member

alexgarel commented Aug 22, 2024

Problem

Right now in search-a-licious, you can declare a field as an object, but there is no way you can specify the sub fields of those objects.

It can also lead to problem at import time. For example I got a float field (in nutrients), which was first interpreted as long (maybe because it was 0 in first elements)... in this case ES won't index some of the record because it can't change the field definition.

Proposed solution

Add a fields property to objects fields, that will works as the fields at the config level.

Also add a dynamic bool property to control the behaviour of ES dynamic property on the Object field.

Additional context

This might be needed if we want to handle nutrients correctly as numbers in Open Food Facts (and insure operators works correctly in rqeuests).

This should not be very difficult to implement:

  • add it in config.py + add validators to ensure we add those properties only for meaningful objects
  • use this configuration in generate_dsl_field
@alexgarel alexgarel added the ✨ enhancement New feature or request label Aug 22, 2024
@github-project-automation github-project-automation bot moved this to Backlog (ready for dev) in 🔎 Search-a-licious Aug 22, 2024
@alexgarel alexgarel moved this from Backlog (ready for dev) to Todo (selected) in 🔎 Search-a-licious Aug 27, 2024
@alexgarel
Copy link
Member Author

I bumped priority because it can lead to dangerous pitfalls, as added in the comment. I loose time today because of this.

@teolemon teolemon removed the ✨ enhancement New feature or request label Oct 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Todo (selected)
Development

No branches or pull requests

2 participants