[ 
https://issues.apache.org/jira/browse/SOLR-1553?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ryan McKinley updated SOLR-1553:
--------------------------------

    Attachment: edismax.unescapedcolon.bug.test.patch

+1 to mark as experimental in 3.1

----

The innards of how this works it totally greek, but tried finding somethign to 
fix hoss' unescaped patch.  It seems that the root of the problem is that 
QueryParserBase.parse( String ) will return a BooleanQuery with no clauses for 
the invalid field query.
{code:java}
Query res = TopLevelQuery(field);
return res!=null ? res : newBooleanQuery(false);
{code}
Then the edismax just checks if the parsedQuery is null to see if it is valid.

I tried just returning null from the QueryParserBase, but that (not 
surprisingly) breaks other tests like TestMultiFieldQueryParser.  I imagine 
somethign changed here for why it used to work, and now "mysteriously" does 
not.  

Adding a check for empty BooleanQuery fixes this in edismax though:
{code:java}
 if( parsedUserQuery instanceof BooleanQuery ) {
   if( ((BooleanQuery)parsedUserQuery).getClauses().length < 1 ) {
     parsedUserQuery = null;
   }
 }
{code}

All tests pass... but can someone who knows what the ramifications of this 
change means take a look?

> extended dismax query parser
> ----------------------------
>
>                 Key: SOLR-1553
>                 URL: https://issues.apache.org/jira/browse/SOLR-1553
>             Project: Solr
>          Issue Type: New Feature
>            Reporter: Yonik Seeley
>            Assignee: Yonik Seeley
>             Fix For: 1.5, 3.1, 4.0
>
>         Attachments: SOLR-1553.patch, SOLR-1553.pf-refactor.patch, 
> edismax.unescapedcolon.bug.test.patch, edismax.unescapedcolon.bug.test.patch, 
> edismax.userFields.patch
>
>
> An improved user-facing query parser based on dismax

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to