gerlowskija commented on code in PR #2499:
URL: https://github.com/apache/solr/pull/2499#discussion_r1668958020
##########
solr/core/src/java/org/apache/solr/search/ComplexPhraseQParserPlugin.java:
##########
@@ -134,6 +135,19 @@ protected Query
newWildcardQuery(org.apache.lucene.index.Term t) {
}
}
+ @Override
+ protected Query getPrefixQuery(String field, String termStr)
throws ParseException {
+ // TODO check the field type and call QueryUtils.ensureBlah here
Review Comment:
I did find a way to make this change, but ended up backing off of it. (I
pushed that change to this PR but then reverted it, if you're curious to what
was involved.)
A few reasons for that back off:
1. It ended up causing some complications on the Lucene-side.
ComplexPhraseQueryParser (the Lucene class) makes certain type assumptions
about the Query instances it handles. Injecting our own FieldType/schema aware
query-creation logic into that class breaks those expectations in a pretty big
way and causes a lot of test failures 😦
2. It's orthogonal to my main goal in this PR, and I'm leery of scope creep.
3. If we do want to address this, it's probably something that merits its
own ticket to investigate and fix. After all, this probably isn't the only
place in Solr that calls directly into a Lucene QueryParser without somehow
creating sub-queries in a FieldType-aware way.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]