Hi Thomas, I can’t reproduce the exact results, but this might be caused by the space character, which is double-encoded (%2520). Are you still seeing the issue if you replace it with %20?
Kind regards, Patryk On 2024/09/14 08:56:55 Thomas Åkesson wrote: > Hi, > We have come across a potentially incorrect lexical error with the following > combination in the query: > - Parentheses in the search term (tried both escaping and quoting) > - Query parser within {}. Actual use-case is using !graph but clearer > reproduction with something simple like !boost. > - Using AND before the {!something ...} query. > > This query fails: > curl > 'http://localhost:8983/solr/demo/select?q=inStock:true+AND+%7B%21boost+b%3Dmanufacturedate_dt%7Dname%3Athe%2520%5C%28concept%5C%29.xml' > { > "responseHeader":{ > "status":400, > "QTime":1, > "params":{ > "q":"inStock:true AND {!boost > b=manufacturedate_dt}name:the%20\\(concept\\).xml" > } > }, > "error":{ > > "metadata":["error-class","org.apache.solr.common.SolrException","root-error-class","org.apache.solr.parser.TokenMgrError"], > "msg":"org.apache.solr.search.SyntaxError: Cannot parse > 'name:the%20\\(concept\\': Lexical error at line 1, column 22. Encountered: > <EOF> (in lexical state 3)", > "code":400 > } > > > Fails when quoted (no escaping needed?): > curl > 'http://localhost:8983/solr/demo/select?q=inStock:true+AND+%7B%21boost+b%3Dmanufacturedate_dt%7Dname%3A%22the%2520%28concept%29.xml%22' > { > "responseHeader":{ > "status":400, > "QTime":1, > "params":{ > "q":"inStock:true AND {!boost > b=manufacturedate_dt}name:\"the%20(concept).xml\"" > } > }, > "error":{ > > "metadata":["error-class","org.apache.solr.common.SolrException","root-error-class","org.apache.solr.parser.TokenMgrError"], > "msg":"org.apache.solr.search.SyntaxError: Cannot parse > 'name:\"the%20(concept': Lexical error at line 1, column 21. Encountered: > <EOF> after prefix \"\\\"the%20(concept\" (in lexical state 3)", > "code":400 > } > > Removing the closing parenthesis works: > curl > 'http://localhost:8983/solr/demo/select?q=inStock:true+AND+%7B%21boost+b%3Dmanufacturedate_dt%7Dname%3Athe%2520%5C%28concept.xml' > > Removing the statement before works: > curl > 'http://localhost:8983/solr/demo/select?q=%7B%21boost+b%3Dmanufacturedate_dt%7Dname%3Athe%2520%5C%28concept%5C%29.xml' > > > Has anyone seen this issue before? Tested with 8.3 and 9.6.1. > > Thanks in advance, > Thomas Å. > > > > > > > > >