| Summary: | File service: move search parameters out of query | ||
|---|---|---|---|
| Product: | [ECD] Orion | Reporter: | Mark Macdonald <mamacdon> |
| Component: | Client | Assignee: | libing wang <libingw> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | libingw |
| Version: | 0.5 | ||
| Target Milestone: | 2.0 M2 | ||
| Hardware: | PC | ||
| OS: | Windows 7 | ||
| Whiteboard: | |||
(In reply to comment #0) > The 'query' parameter encodes everything about the search: the term the user > typed in, whether it's a filename or file contents search, how many > what field to sort on, etc. Should say **how many results to show, what field to sort on, etc.** The object shape I gave in Comment 0 is just an example... We might want a more generic way of specifying that a search be restricted to certain fields only (of which "Name" would be the most obvious one). Talked to Mark. We are going to do this in 1.0 as it is not a blocker for 0.5 Triage in 2.0M1. This has been fixed when I fixed Bug 392849. http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=2d433886bc91cdbceafa03ea349473dad0922079 |
The 'search' function of the file service API looks like this: search: function(/**String*/ location, /**String*/ query) The 'query' parameter encodes everything about the search: the term the user typed in, whether it's a filename or file contents search, how many what field to sort on, etc. This is not ideal if you're implementing support for another file back end, since you need to interpret the query to figure out what the search options are. It would be better if arguments were passed inside an object: { query: String // search term isFilename: Boolean // true to search filenames only itemsPerPage: Number startItem: Number sortKey: String sortDirection: String ... etc } This would make it the file service's job to construct whatever request is necessary to talk to the back end system. The Orion client UI would deal in named parameters, and not construct any query strings itself.