Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 389844 - Location-scoped search can't handle path with spaces
Summary: Location-scoped search can't handle path with spaces
Status: RESOLVED FIXED
Alias: None
Product: Orion
Classification: ECD
Component: Server (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 1.0 RC1   Edit
Assignee: John Arthorne CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-18 16:51 EDT by John Arthorne CLA
Modified: 2012-09-27 14:27 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Arthorne CLA 2012-09-18 16:51:06 EDT
I20120917-2230

1) Create a folder with spaces in the name
2) Drill into the folder
3) Attempt a global search within the folder

-> It fails to find anything. Spaces are term delimiters, so this search:

q=foo%20Location:/file/my%20folder

Actually means three search terms:

foo AND Location:/file/my AND folder

We need to put quotes around the entire location so it is treated as a single term:

q=foo%20Location:%22/file/my%20folder%22
Comment 1 libing wang CLA 2012-09-19 09:35:27 EDT
On client side, we may not want to put %22 directly in the search.html hash as it is consumed by both indexer and crawler. 

The way I put quotes around search term with white space is not the hash but inside searchResults._search() function, where "qObj.searchStrWithWhiteSpace" appears.
Comment 2 John Arthorne CLA 2012-09-19 16:06:09 EDT
Actually I realized that the "Location" field contains an encoded URI, so it is impossible for it to have spaces. However this means the query is perhaps not being encoded correctly. If I want to find a file with this URI:

/file/A/My%20Project/a.txt

Then the location field needs to be encoded as:

/file/A/My%2520Project/a.txt

I am still working on it...
Comment 4 John Arthorne CLA 2012-09-27 14:27:21 EDT
There was one last case not working: top-level folder name with space in the name:

http://git.eclipse.org/c/orion/org.eclipse.orion.server.git/commit/?id=66458d88e82f1191285b6d598d6aa8cb449f7a98