Community
Participate
Working Groups
I happened to hit this issue when I was trying to copy a search sting and paste it in the search box. The string contains white space at the end. After I press enter key, I got GET http://localhost:8080/filesearch?sort=Path%20asc&rows=40&start=0&q=createFrame%20+Location:/file/e/* 500 (org.apache.solr.client.solrj.SolrServerException: org.apache.solr.common.SolrException: org.apache.lucene.queryParser.ParseException: Cannot parse 'createframe AND AND Location:/file/e/* AND UserName:wwww': Encountered " <AND> "AND "" at line 1, column 17. Was expecting one of: <NOT> ... "+" ... "-" ... "(" ... "*" ... <QUOTED> ... <TERM> ... <PREFIXTERM> ... <WILDTERM> ... "[" ... "{" ... <NUMBER> ... <TERM> ... "*" ...)
Do we support white space at the end? If not, should we eliminate the white space before constructing the URL?
Yes I think we should trim the value from the query text box before constructing the URL. In the Solr syntax whitespace is a separator between terms. Whitespace certainly gets ignored anyway in the search implementation.
I just realized this is a bug in our processing on the server.
I have released a server side fix for the 500 error: http://git.eclipse.org/c/orion/org.eclipse.orion.server.git/commit/?id=1ea7059c4690f6a94d7974dfce44e887146aefcf However the client side post-processing will also need to trim the query so it finds the same matches.
Moving to Libing for client side part.
Client side code follow up. http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=c7351323fa3d587473212ca2587bbdec4d3f319f There are two places to safe guard the code now: 1.When the search URL is constructed, it trims the white space(preceding, middle,post) from the original user input. 2.If the white space is added directly in the URL, "in file search" will trim then as well.