[ 
https://issues.apache.org/jira/browse/SOLR-5669?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17018051#comment-17018051
 ] 

Gus Heck commented on SOLR-5669:
--------------------------------

This is more an undocumented feature than a bug. That error message comes fromĀ 
SolrQueryParserBase:

{code}
  /** Returns the numeric value of the hexadecimal character */
  static final int hexToInt(char c) throws ParseException {
    if ('0' <= c && c <= '9') {
      return c - '0';
    } else if ('a' <= c && c <= 'f'){
      return c - 'a' + 10;
    } else if ('A' <= c && c <= 'F') {
      return c - 'A' + 10;
    } else {
      throw new ParseException("Non-hex character in Unicode escape sequence: " 
+ c);
    }
  }
{code}

I don't find documentation of it in the ref guide however, so that could be 
added. For edismax one might also request an enhancement to not error on this, 
which would be consistent with the stated goal in the edismax docs of being 
tolerant of errors. This ticket however should probably only document the 
feature in the ref guide. (or point to said documentation if my quick search 
through the guide failed to reveal it)

> queries containing \u  return error: "Truncated unicode escape sequence."
> -------------------------------------------------------------------------
>
>                 Key: SOLR-5669
>                 URL: https://issues.apache.org/jira/browse/SOLR-5669
>             Project: Solr
>          Issue Type: Bug
>          Components: query parsers
>    Affects Versions: 4.4
>            Reporter: Dorin Oltean
>            Priority: Minor
>
> When I do the following query:
> /select?q=\ujb
> I get 
> {quote}
> "org.apache.solr.search.SyntaxError: Non-hex character in Unicode escape 
> sequence: j",
> {quote}
> To make it work i have to put in fornt of the query nother '\'
> {noformat}\\ujb{noformat}
> wich in fact leads to a different query in solr.
> I use edismax qparser.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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

Reply via email to