Patch #821
Patch for #791 (Search for all projects issues)
| Status: | Closed | Start: | 2008-03-10 | |
| Priority: | Normal | Due date: | ||
| Assigned to: | - | % Done: | 0% |
|
| Category: | Search engine | |||
| Target version: | 0.8 | |||
Description
History
2008-03-16 02:16 - W Snyder
- File 311_search_all_projects_default.patch added
This updates the patch to work with revision #1249, and also makes all_projects be the default when inside a project.
IMHO having a single search dialog that always works the same is far more intuitive (people expect Google behavior), and so I'm going to modify it slightly so the outside-a-project search also searches all projects. But, that seems beyond the intent of the original patch, so this is not included in my mod.
2008-03-16 18:07 - Jean-Philippe Lang
- Category set to Search engine
- Target version set to 0.8
This is definitely a must-have feature.
But with this patch, the number of queries will grow with the total number of projects. I would prefer a solution where a single query is executed for each kind of object (as it's done for the cross-project activity view). I'll work on it.
By the way, there's a small bug in the object_types_and_scope method: the @project instance variable is used instead of the argument.
2008-05-17 01:53 - Peter Van den Bosch
- File search_all_projects.png added
- File search_all_projects_from_home.png added
- File search_all_projects_one_query.patch added
Hi, I wrote a patch which does it in a single query per object while limiting the scope to only projects for which the user has the necessary permissions.
Included some screenies too.
The behavior of the patch is as follows:
When not inside a project:- searches all projects including project names
- only checkboxes for categories where a user has a right to in some project are rendered
- the automatic redirect to a project if only one result has been removed
- defaults to search inside the project only
- a checkbox is present to search in all projects (maybe this should be the default?)
- does not search in project names (maybe should be present as a greyed out option when 'search all projects' is unchecked)
Could you give feedback on this patch? I'd like to make it ready for inclusion.
btw, it still has some problems with anonymous users and non-members when searching all projects. This is because User.allowed_to? returns false for :global instead of checking anonymous and non-member roles.
2008-05-18 18:18 - Jean-Philippe Lang
- Status changed from New to Closed
Functionality added in r1435.
Peter: your patch looks to work fine but I used a different approach that should be a bit more efficient when there are many public projects. Thanks.
Also, I added the ability to search 'My projects' only.