You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by GitBox <gi...@apache.org> on 2019/08/25 22:15:13 UTC

[GitHub] [lucene-solr] ctroullis opened a new pull request #845: SOLR-13699 - maxChars no longer working on CopyField with Javabin

ctroullis opened a new pull request #845: SOLR-13699 - maxChars no longer working on CopyField with Javabin
URL: https://github.com/apache/lucene-solr/pull/845
 
 
   <!--
   Before creating a pull request, please file an issue in the ASF Jira system for Lucene or Solr:
   
   * https://issues.apache.org/jira/projects/LUCENE
   * https://issues.apache.org/jira/projects/SOLR
   
   You will need to create an account in Jira in order to create an issue.
   
   The title of the PR should reference the Jira issue number in the form:
   
   * LUCENE-####: <short description of problem or changes>
   * SOLR-####: <short description of problem or changes>
   
   LUCENE and SOLR must be fully capitalized. A short description helps people scanning pull requests for items they can work on.
   
   Properly referencing the issue in the title ensures that Jira is correctly updated with code review comments and commits. -->
   
   
   # Description
   
   A regression was introduced as part of the optimizations made in [SOLR-12992](SOLR-12992), which caused the maxChars property to no longer work as expected when indexing via Javabin. Text fields below a certain size limit now are read as ByteArrayUtf8CharSequence instead of Strings, which causes an instanceOf check to fail when attempting to apply the maxChars truncation.
   
   # Solution
   
   Changed the instanceOf check to use the more generic CharSequence, which is implemented by both String and the new ByteArrayUtf8CharSequence. This will allow the truncation to be applied regardless of type.
   
   This solution was discussed with Noble Paul and others in [SOLR-13699](https://issues.apache.org/jira/browse/SOLR-13699).
   
   # Tests
   
   Added a test to DocumentBuilder to test the maxChars truncation given both a String value and a ByteArrayUtf8CharSequence value. Check that both values are truncated appropriately according to maxChar rules.
   
   A future enhancement would be to get all tests running in multiple formats (XML/JSON/Javabin), as this regression would have been caught by the existing CopyField tests if this was the case.
   
   # Checklist
   
   Please review the following and check all that apply:
   
   - [x] I have reviewed the guidelines for [How to Contribute](https://wiki.apache.org/solr/HowToContribute) and my code conforms to the standards described there to the best of my ability.
   - [x] I have created a Jira issue and added the issue ID to my pull request title.
   - [x] I am authorized to contribute this code to the ASF and have removed any code I do not have a license to distribute.
   - [x] I have developed this patch against the `master` branch.
   - [x] I have run `ant precommit` and the appropriate test suite.
   - [x] I have added tests for my changes.
   - [ ] I have added documentation for the [Ref Guide](https://github.com/apache/lucene-solr/tree/master/solr/solr-ref-guide) (for Solr changes only).
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org