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

SOLR-16360: Atomic update on boolean fields doesn't reflect when value starts with "1", "t" or "T" #1816

Merged
merged 11 commits into from
Aug 9, 2023

Conversation

rahulgoswami
Copy link
Contributor

@rahulgoswami rahulgoswami commented Jul 30, 2023

https://issues.apache.org/jira/browse/SOLR-16360

Description

Added a change in toNativeType(Object val) method of BoolField.java to check for the first character of val and return true if it is '1', 't' or 'T'

Solution

Added a change in toNativeType(Object val) method of BoolField.java to check for the first character of val and return true if it is '1', 't' or 'T'

Tests

Please describe the tests you've developed or run to confirm this patch implements the feature or solves the problem.

Checklist

Please review the following and check all that apply:

  • I have reviewed the guidelines for How to Contribute and my code conforms to the standards described there to the best of my ability.
  • I have created a Jira issue and added the issue ID to my pull request title.
  • I have given Solr maintainers access to contribute to my PR branch. (optional but recommended)
  • I have developed this patch against the main branch.
  • I have run ./gradlew check.
  • I have added tests for my changes.
  • I have added documentation for the Reference Guide

@rahulgoswami rahulgoswami changed the title SOLR-16360: Atomic update on boolean fields doesn't reflect when value starts with "1", "t" or "T"Fix for SOLR-16360 SOLR-16360: Atomic update on boolean fields doesn't reflect when value starts with "1", "t" or "T" Jul 30, 2023
@rahulgoswami rahulgoswami marked this pull request as ready for review August 3, 2023 03:08
@dsmiley
Copy link
Contributor

dsmiley commented Aug 3, 2023

Can you add a test please?

@rahulgoswami
Copy link
Contributor Author

On it!

@justinrsweeney
Copy link
Contributor

Are we able to reuse the code from StrUtils for this instead of duplicating?

@rahulgoswami
Copy link
Contributor Author

Added tests and incorporated Justin's comment.

… to avoid having to change the latter for atomic update
Copy link
Contributor

@justinrsweeney justinrsweeney left a comment

Choose a reason for hiding this comment

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

👍 Looks good!

Copy link
Contributor

@dsmiley dsmiley left a comment

Choose a reason for hiding this comment

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

If we're going to use StrUtils.parseBoolean here (makes sense), shouldn't we change toInternal to use it too?

solr/core/src/java/org/apache/solr/schema/BoolField.java Outdated Show resolved Hide resolved
@dsmiley
Copy link
Contributor

dsmiley commented Aug 7, 2023

Can you please add an entry to CHANGES.txt under 9.4 (the next release)

@rahulgoswami
Copy link
Contributor Author

Would it make sense for this to be considered for 8.11.3 release next month ?

@dsmiley
Copy link
Contributor

dsmiley commented Aug 8, 2023

Yes (if you want to back-port), but that shouldn't affect CHANGES.txt for now because that's a special situation.

@rahulgoswami
Copy link
Contributor Author

This is done. Awaiting review. Thanks.

# Conflicts:
#	solr/CHANGES.txt
@dsmiley dsmiley merged commit 9b88eb8 into apache:main Aug 9, 2023
2 of 3 checks passed
dsmiley pushed a commit that referenced this pull request Aug 9, 2023
…e starts with "1", "t" or "T" (#1816)

* StrUtils.parseBoolean() can accept a CharSequence

---------

Co-authored-by: Rahul Goswami <rgoswami@commvault.com>
@rahulgoswami rahulgoswami deleted the SOLR-16360 branch August 10, 2023 03:44
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.

4 participants