solr
solr copied to clipboard
@sayandigital SOLR-13182 - NullPointerException
https://issues.apache.org/jira/browse/SOLR-13182
Description
Please provide a short description of the changes you're making with this pull request. There is a null pointer exception if the parent query is missing .
Solution
Please provide a short description of the approach taken to implement your solution. The parent query adds an additional boolean query .Only if parent is present add boolean query or else match all docs.
Tests
Please describe the tests you've developed or run to confirm this patch implements the feature or solves the problem. Test cases run on the entire code.
Checklist
Please review the following and check all that apply:
- [x] I have reviewed the guidelines for How to Contribute 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.
- [ ] I have given Solr maintainers access to contribute to my PR branch. (optional but recommended)
- [x] I have developed this patch against the
mainbranch. - [x] I have run
./gradlew check. - [x] I have added tests for my changes.
- [x] I have added documentation for the Reference Guide
@epugh Can you please review this.I am a newbie It shows "First-time contributors need a maintainer to approve running workflows."
@sayandigital I'm going to click the workflow now.
However, two things to ready this for committing:
-
Can you add a unit test that demonstrates the NPE? That would make it easier for me to verify the fix.
-
Can you back out the documentation fix, since I captured that in the other PR!
And, I guess, can you add an entry to the CHANGES.txt crediting how you want it to be fixed.
@sayandigital I'm going to click the workflow now.
However, two things to ready this for committing:
- Can you add a unit test that demonstrates the NPE? That would make it easier for me to verify the fix.
- Can you back out the documentation fix, since I captured that in the other PR!
And, I guess, can you add an entry to the CHANGES.txt crediting how you want it to be fixed.
@epugh I have updated the PR as per the review comments
@epugh I dont have access to add you as reviewer
I think this looks fine to me, but I'm thinking about whether it makes more sense to return a useful error message in this case rather than silently defaulting to no parent query. @dsmiley you've had a lot of time with block joins, do you have opinion here?
I pushed a commit that re-did your tests. The syntax was already wrong/weird (with 'q' instead of "of", and with the extra '{' creating an imbalance. I also wanted to test the parent QParser and to use one of Solr's test utilities to expressly test for a bad request instead of a RuntimeException generally.
You still need to redo the formatting. I think you should also remove the needless newline you put at the beginning and end of the changed method. You might consider starting all-over and force-pushing.
http://localhost:8983/solr/films/select?q={!child%20q={} - This is the query shared in the jira which is invalid
Feel free to add another line of test code to test that one.