Patch #821

Patch for #791 (Search for all projects issues)

Added by Angel Sciortino almost 10 years ago. Updated over 9 years ago.

Status:ClosedStart date:2008-03-10
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Search engine
Target version:0.8

Description

This allows for searches in all projects as requested in #791.

Applies cleanly to r1212.

search_all_projects.diff Magnifier (4.8 KB) Angel Sciortino, 2008-03-10 02:40

311_search_all_projects_default.patch Magnifier (4.22 KB) W Snyder, 2008-03-16 02:16

search_all_projects.png (85.6 KB) Peter Van den Bosch, 2008-05-17 01:53

search_all_projects_from_home.png (76.2 KB) Peter Van den Bosch, 2008-05-17 01:53

search_all_projects_one_query.patch Magnifier (7.58 KB) Peter Van den Bosch, 2008-05-17 01:53


Related issues

Related to Redmine - Feature #791: Search for all projects issues Closed 2008-03-05

History

#1 Updated by Angel Sciortino almost 10 years ago

Also patch for #379 (#791 is a duplicate)

#2 Updated by W Snyder almost 10 years ago

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.

#3 Updated by Jean-Philippe Lang over 9 years ago

  • 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.

#4 Updated by Peter Van den Bosch over 9 years ago

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
When inside a project:
  • 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.

#5 Updated by Jean-Philippe Lang over 9 years ago

  • 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.

#6 Updated by José Campos over 9 years ago

Please, help me understand this: Is it a desired feature that a user can see issues from projects he does not belongs to?
When I search outside a project, I can see in the search results issues belonging to projects that are supposed to be restricted to me...

Also available in: Atom PDF