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 coerce option for text and numbers types #1904

Merged
merged 3 commits into from
Mar 1, 2023
Merged

add coerce option for text and numbers types #1904

merged 3 commits into from
Mar 1, 2023

Conversation

PSeitz
Copy link
Contributor

@PSeitz PSeitz commented Feb 24, 2023

allow to coerce the field type when indexing if the type does not match

allow to coerce the field type when indexing if the type does not match
@codecov-commenter
Copy link

codecov-commenter commented Feb 24, 2023

Codecov Report

Merging #1904 (60f8955) into main (5f23bb7) will decrease coverage by 0.04%.
The diff coverage is 79.54%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@            Coverage Diff             @@
##             main    #1904      +/-   ##
==========================================
- Coverage   94.49%   94.46%   -0.04%     
==========================================
  Files         307      307              
  Lines       55483    55686     +203     
==========================================
+ Hits        52430    52601     +171     
- Misses       3053     3085      +32     
Impacted Files Coverage Δ
src/schema/flags.rs 45.00% <0.00%> (-2.37%) ⬇️
src/schema/json_object_options.rs 87.36% <ø> (ø)
src/schema/mod.rs 100.00% <ø> (ø)
src/schema/field_type.rs 78.54% <75.51%> (-0.59%) ⬇️
src/schema/text_options.rs 97.40% <80.00%> (-2.60%) ⬇️
src/schema/numeric_options.rs 97.96% <92.30%> (-2.04%) ⬇️
src/directory/directory.rs 90.14% <0.00%> (-1.41%) ⬇️
src/lib.rs 98.94% <0.00%> (ø)
src/schema/schema.rs 98.92% <0.00%> (ø)
... and 7 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Collaborator

@fulmicoton fulmicoton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unit tests needed (that's a good change though)

@PSeitz
Copy link
Contributor Author

PSeitz commented Feb 28, 2023

Unit tests needed (that's a good change though)

Yes, I was just checking first if that's the right direction

@PSeitz PSeitz requested a review from fulmicoton March 1, 2023 03:52
@@ -17,6 +18,12 @@ pub struct NumericOptions {
fieldnorms: bool, // This attribute only has an effect if indexed is true.
fast: bool,
stored: bool,
#[serde(skip_serializing_if = "is_false")]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a reason to skip serialization?

Suggested change
#[serde(skip_serializing_if = "is_false")]

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just a little less noise when reading the meta.json

@@ -17,6 +17,14 @@ pub struct TextOptions {
stored: bool,
#[serde(default)]
fast: bool,
#[serde(default)]
#[serde(skip_serializing_if = "is_false")]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#[serde(skip_serializing_if = "is_false")]

@PSeitz PSeitz merged commit faa706d into main Mar 1, 2023
@PSeitz PSeitz deleted the mainbrunch branch March 1, 2023 10:37
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

Successfully merging this pull request may close these issues.

3 participants