-
Notifications
You must be signed in to change notification settings - Fork 702
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-15546: ShortestPathStream to handle ids with colons. #236
base: main
Are you sure you want to change the base?
Conversation
@@ -433,7 +433,7 @@ public JoinRunner(List<String> nodes) { | |||
StringBuffer nodeQuery = new StringBuffer(); | |||
|
|||
for(String node : nodes) { | |||
nodeQuery.append(node).append(" "); | |||
nodeQuery.append('"').append(node).append('"').append(" "); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens if there are quotes in the id?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good remark
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens if there are quotes in the id?
Good question! I'd briefly wondered about the backwards compatibility aspects w.r.t. adding surrounding quotes in the code when the caller already added them as a workaround, and then I had lost track of that.
One difference between the code adding surrounding quotes vs. the caller adding them is that the code also adds them for interim nodes. I've amended the test coverage to explore that further.
Also adjusted the code change to not add surrounding quotes if there are some already but obviously quotes could also be in the middle of the id, say Alice ("Ally")
or Robert ("Bob")
both of which also contain parentheses as it happens, hmm.
I didn’t even consider the “quoted” case, I was thinking of text with a quote character in the middle. But I’m glad that we are thinking about that one too! |
I would speculate that somehow encoding the id might be one approach? The text could contain quotes in the middle or apostrophe or colon or space or other stuff too. |
This reverts commit e4df590.
…urrounding quotes back compat)
Hmm, have tried but not yet found a way to support quotes in the middle. And if there is a space in the text then the code adding surrounding quotes changes the results, so with that behaviour change in mind perhaps any fix would be for 9x only and then no need to consider the scenario of the caller having added surrounding quotes since backwards compatibility is not retained anyhow? Either way, I've amended the test coverage to include space and single and double quotes. |
I think we still want to back port a fix for colons at least to 8x? Maybe there are parts that stay 9x only, but I think this is probably something important to have in our release line |
One way for a backwards compatible or "backwards compatible friendly" change for the 8x release line could be via an optional flag:
or
for fixed behaviour with the option of
for backwards compatible behaviour. So |
solr/solrj/src/java/org/apache/solr/client/solrj/io/graph/ShortestPathStream.java
Outdated
Show resolved
Hide resolved
solr/solrj/src/java/org/apache/solr/client/solrj/io/graph/ShortestPathStream.java
Outdated
Show resolved
Hide resolved
This PR had no visible activity in the past 60 days, labeling it as stale. Any new activity will remove the stale label. To attract more reviewers, please tag someone or notify the [email protected] mailing list. Thank you for your contribution! |
This PR is now closed due to 60 days of inactivity after being marked as stale. Re-opening this PR is still possible, in which case it will be marked as active again. |
@cpoerschke if we assume this code would only go on |
This PR has had no activity for 60 days and is now labeled as stale. Any new activity will remove the stale label. To attract more reviewers, please tag people who might be familiar with the code area and/or notify the [email protected] mailing list. To exempt this PR from being marked as stale, make it a draft PR or add the label "exempt-stale". If left unattended, this PR will be closed after another 60 days of inactivity. Thank you for your contribution! |
I'd love to see this get into 10 without the |
Sure, please feel free to take this over etc. -- thanks! |
I've tried to take a stab at this, and honestly I think I made this one worse. I think this is going to be one of those "someday if I need this, or a smarter person comes along with a fix, let's look at it again" issue.. Thoughts on adding a warning to the docs to the effect the id's can't have colons instead? |
https://issues.apache.org/jira/browse/SOLR-15546