dsmiley commented on a change in pull request #129:
URL: https://github.com/apache/solr/pull/129#discussion_r644187229



##########
File path: solr/core/src/java/org/apache/solr/parser/SolrQueryParserBase.java
##########
@@ -1149,18 +1151,21 @@ protected Query getFieldQuery(String field, 
List<String> queryTerms, boolean raw
         return newFieldQuery
             (getAnalyzer(), field, queryText, false, 
fieldAutoGenPhraseQueries, fieldEnableGraphQueries, synonymQueryStyle);
       } else {
-        if (raw) {
+        if (raw) {// assumption: raw = false only when called from 
ExtendedDismaxQueryParser.getQuery()
           return new RawQuery(sf, queryTerms);
         } else {
           if (queryTerms.size() == 1) {
             return ft.getFieldQuery(parser, sf, queryTerms.get(0));
+          } else if(ft instanceof StrField){

Review comment:
       Adding a special case that references a specific field type is a code 
smell.  Ideally, the FieldType API and/or interfaces express the logic to gate 
on here.  There are already too many special cases in the existing code IMO.  
It seems to be already the case with ft.isTokenized().  I know the ultimate 
result is debatable but it's both-ways -- there's no obvious correct answer 
IMO.  The differing behavior is something users are advised to steer clear away 
from, e.g. by using consistently analyzed fields in "qf".




-- 
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org

Reply via email to