-
Notifications
You must be signed in to change notification settings - Fork 758
SOLR-15449: edismax sow and mm #158
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
Conversation
… fix for not compatible query term-field + tests
… fix for not compatible query term-field + tests
@dsmiley @janhoy @madrob @munendrasn @romseygeek @sarowe , the issue with sow and mm found in: #129 has been isolated here and it's ready for an initial review. |
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.
Other than formatting matters, I think this is good!
solr/core/src/java/org/apache/solr/parser/SolrQueryParserBase.java
Outdated
Show resolved
Hide resolved
@@ -1776,6 +1764,36 @@ private static String getParsedQuery(SolrQueryRequest request) throws Exception | |||
return (String) BaseTestHarness.evaluateXPath(resp, "//str[@name='parsedquery']/text()", XPathConstants.STRING); | |||
} | |||
|
|||
public void testSplitOnWhitespace_shouldRespectMinimumShouldMatch(){ |
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.
The indentation here is inconsistent. Please configure your IDE so that this simply doesn't happen.
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.
I think I've done it, formatting is one of the things I hate the most, my opinion is that it shouldn't be the responsibility of single peers but it should be server side to avoid inconsistencies(which I often find also in Lucene/Solr and other Open Source code).
Never really explored a solution for that either, so I hope, my changes are ok now :)
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.
https://issues.apache.org/jira/browse/SOLR-14920 -- I anticipate this will happen for 9.0 soon.
solr/core/src/test/org/apache/solr/search/TestExtendedDismaxParser.java
Outdated
Show resolved
Hide resolved
solr/core/src/java/org/apache/solr/parser/SolrQueryParserBase.java
Outdated
Show resolved
Hide resolved
solr/core/src/java/org/apache/solr/parser/SolrQueryParserBase.java
Outdated
Show resolved
Hide resolved
// When sow=false, the per-field query structures differ (no "Terminator" query on integer field foo_i), | ||
// so a dismax-per-field is constructed. As a result, mm=100% is applied per-field instead of per-term; | ||
// since there is only one term (100) required in the foo_i field's dismax, the query can match docs that | ||
// only have the 100 term in the foo_i field, and don't necessarily have "Terminator" in any field. |
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.
@sarowe, the above comment (from dd171ff) describes behavior that seems counterintuitive, but it doesn't give any indication of whether the behavior might be considered desirable for some reason? The behavior described would be changed by this PR; this seems like it would be an improvement, but I wanted to call your attention to this comment specifically, just to make sure you're aware/supportive of the change.
As soon as I see an approval and we get potentially a final feedback by @sarowe , I am happy to merge. For cherry picking, I was just taking a look to the minor version branches but I couldn't find them, has anything changed after the split? |
The new apache/solr repo only contains main branch, and will eventually contain branch_9x etc. |
@dsmiley I see that changes are still requested, can you check that? |
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.
Thanks Alessandro!
# Conflicts: # solr/CHANGES.txt
If we fail to delete files that belong to a commit point, then we will expose that deleted commit in the next calls of IndexDeletionPolicy#onCommit. I think we should never expose those deleted commit points as some of their files might have been deleted already.
https://issues.apache.org/jira/browse/SOLR-15449
Description
When a field text analysis is incompatible with the query text, mm is not fully respected:
Solution
Instead of just ignoring un-parsable clauses, a noMatch query is added
Tests
tests have been added to: org.apache.solr.search.TestExtendedDismaxParser
Checklist
Please review the following and check all that apply:
main
branch../gradlew check
.