[ https://issues.apache.org/jira/browse/SOLR-5163?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16595370#comment-16595370 ]
Edward Ribeiro commented on SOLR-5163: -------------------------------------- Hi [~Charles Sanders], a couple of questions about your patch (congrats for contributing, btw!): {code:java} validateQueryFields(req);{code} You pass req, but req is only used to get the Schema, so why not pass the schema, i.e., validateQueryFields(req.getSchema())? {code:java} protected void validateQueryFields(SolrQueryRequest req) throws SyntaxError { if (queryFields == null || queryFields.isEmpty()) { throw new SyntaxError("No query fields given."); }{code} If df is not specified then the parser will resort to use df (or throw an exception if neither is specified). Therefore, even tough this if clause is a nice defensive guard I don't think it really is worth now, because if queryFields is empty the error will be thrown before reaching this method. And even if is empty then the result is that the for-loop is not traversed. Finally, {code:java} req.getSchema().getFields().keySet(){code} could be extracted to a variable before entering the loop, instead of being called for each field. Best regards! > edismax should throw exception when qf refers to nonexistent field > ------------------------------------------------------------------ > > Key: SOLR-5163 > URL: https://issues.apache.org/jira/browse/SOLR-5163 > Project: Solr > Issue Type: Bug > Components: query parsers, search > Affects Versions: 4.10.4 > Reporter: Steven Bower > Assignee: David Smiley > Priority: Major > Labels: newdev > Attachments: SOLR-5163.patch > > > query: > q=foo AND bar > qf=field1 > qf=field2 > defType=edismax > Where field1 exists and field2 doesn't.. > will treat the AND as a term vs and operator -- This message was sent by Atlassian JIRA (v7.6.3#76005) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org