Community
Participate
Working Groups
Some characters in Lucene queries like "-" and "*" must be escaped [1]. The client does that escaping in org.eclipse.orion.client.ui/web/plugins/filePlugin/fileImpl.js function _generateLuceneQuery. However, the server does the same escaping again in SearchServlet line 131 with ClientUtils#escapeQueryChars(). Steps to reproduce: 1. start the server in debug mode and set a break point in SearchServlet on the line: String processedTerm = ClientUtils.escapeQueryChars(term.toLowerCase()); 2. create a file in the client with just the string foo-bar as content 3. do a global search for foo-bar while you watch the HTTP traffic 4. notice that the request sent to the server is something like http://localhost:8080/filesearch?sort=Path%20asc&rows=40&start=0&q=foo%5C-bar+Location:/file* => the dash is escaped as %5C- , i.e. URL-encoded \- 5. notice on the server that term=foo\-bar and processedTerm=foo\\\-bar 6. Lucene interprets that as foo\-bar => no match My gut feeling tells me that the client should not assume anything about the search technology deployed on server side, so I tend to remove the escaping on client side. However, I can't get a clear picture from the git history about why and when this escaping was introduced. So I probably miss some "anecdotes" of this code. [1] http://lucene.apache.org/core/2_9_4/queryparsersyntax.html#Escaping%20Special%20Characters
We are no longer using Apache Solr on the Orion server for search.