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

TermAutomatonQuery explain() should return relevant explain output instead of null #12178

Closed
kashkambath opened this issue Mar 2, 2023 · 3 comments · Fixed by #12208
Closed
Labels

Comments

@kashkambath
Copy link

Description

Hi! This is my first time posting a GitHub issue for Apache Lucene. Please let me know if you need anything further.

@Override
public Explanation explain(LeafReaderContext context, int doc) throws IOException {
// TODO
return null;
}

We should return relevant explain output here instead of returning null for TermAutomatonQuery. This would be helpful for users running document explain on synonym queries leveraging TermAutomatonQuery. Otherwise, certain queries that can nest other queries could throw a NullPointerException if their weight's explain() calls TermAutomatonQuery#explain().

For example, if a BooleanQuery nests a TermAutomatonQuery, then BooleanWeight throws an NPE here when running explain():

Explanation e = w.explain(context, doc);

Version and environment details

No response

@MarcusSorealheis
Copy link
Contributor

MarcusSorealheis commented Mar 20, 2023

@kashkambath this looks good. Thanks for opening the issue. Do you feel like #12208 addresses your concerns? It will surely be reviewed soon. There's obviously more we can do, but the first step is to get the functionality there, and then we can build improvements upon it. There's a lot to do in many areas in perpituity.

@kashkambath
Copy link
Author

@MarcusSorealheis looks reasonable to me, thanks for taking it on!

@MarcusSorealheis
Copy link
Contributor

@MarcusSorealheis looks reasonable to me, thanks for taking it on!

Anytime! Happy to help and more to come. 😁

@zhaih zhaih linked a pull request Apr 7, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants