Project

General

Profile

Actions

Feature #9909

closed

Search in project and its subprojects by default

Added by ed boel almost 13 years ago. Updated over 7 years ago.

Status:
Closed
Priority:
Normal
Category:
Search engine
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed

Description

The default search scope when in a project is now only the selected project.
In my setup there are about 25 different projects, so it is easy if the search scope would always be 'all projects' or 'this and its subprojects'. Is it possible to add a configuration option to enable that?


Files


Related issues

Related to Redmine - Defect #30923: Project search should select subprojects scope when the project has subprojectsClosedGo MAEDA

Actions
Has duplicate Redmine - Feature #23403: Make default search scope configurableClosed

Actions
Has duplicate Redmine - Feature #22125: Make Search default to current project and sub projectsClosed

Actions
Has duplicate Redmine - Feature #24764: Search in subprojectsClosed

Actions
Actions #1

Updated by John Wilcox almost 13 years ago

We are using Redmine internally in our organization and the current search function is confusing for our users also. We are using Redmine for task management (e.g. no RCS and code development stuff) and we have built an hierarchy of projects based on the organizational structure. For example, CIO has three departements beneath him and when searching, by default he would like to search every "project" under him. As it now, he has to make too many clicks to get where he wants and on the other hand the default Redmine search method is not suitable for us at all. So if possible, please make it configurable (preferrably redmine-wide).

Actions #2

Updated by Robert Rath over 12 years ago

Actually there does exist this capability already. When searching from the initial search entry field (usually in the top right of the screen) you only have the choice of one project.

When you actually perform the initial search you are taken to the Redmine search page which gives you the option to search one of;

a) current project,
b) my projects, or
c) all projects.

So a nice to have feature change would be to place 'my projects' and 'all projects' in the initial project choice but not actually necessary.

Actions #3

Updated by André Bachmann over 11 years ago

A quick and dirty way to change this Redmine behaviour is to edit apps/controller/search_controller.rb and edit in class SearchController < ApplicationController the various statements (for example, if you want to change the default search scope to global, you should change the else statement from @project to nil).

projects_to_search =
      case params[:scope]
      when 'all'
        nil
      when 'my_projects'
        User.current.memberships.collect(&:project)
      when 'subprojects'
        @project ? (@project.self_and_descendants.active.all) : nil
      else
        #@project
        nil
      end

Actions #4

Updated by Dotan Cohen over 11 years ago

I very much agree that either searching all subprojects should be the default, or that the default should be configurable.

Actions #5

Updated by Ernő Rigó about 11 years ago

My solution was to update the search form via the site theme. You should create javascripts/theme.js with the following content:

function customSearch() {
    var node = document.getElementById("quick-search");
    node.innerHTML = 
        "<form actuion='/search' method='GET'>" +
        "<a href='/search'>Search:</a>" +
        "<input type=text name=q>" +
        "</form>";
};

if (window.jQuery) { 
  $(window).load(customSearch);
}

Other search options can be easily added via form fields.

Actions #6

Updated by Marc D. about 10 years ago

+1

Actions #7

Updated by Chi Song Tao over 8 years ago

I need this function, too.

Can the default search be configurable for each project?

Actions #8

Updated by Toshi MARUYAMA over 8 years ago

  • Has duplicate Feature #23403: Make default search scope configurable added
Actions #9

Updated by Marius BĂLTEANU over 7 years ago

Many of our projects are organised in a main project with multiple subprojects. For these projects, our users use mostly the "Issues" page from the parent project because it offers a great visibility over the issues, a lot of filters and options (like group by project). Without any subproject filter, a query returns issues from parent project and its subprojects. But if you're using the search input, the results returned are only from the current project (parent in my case). Each time when I search something I've the expectation to get results from the subprojects too. A usual case is when I want to search for an issue after subject (is faster to use the search instead of adding the subject filter ).

The attached patch changes the search behaviour in order to include results from "<Project and its subprojects" by default. In this way, query scope and search scope are consistent between them.

I'm not sure if it is worth it to add a setting in admin for this.

Actions #10

Updated by Go MAEDA over 7 years ago

  • Target version set to Candidate for next major release

I think that the suggested patch by Marius can improve consistency.

We see issues of subprojects by default in issues page (Default value of Setting.display_subprojects_issues is True). So including issues from subprojects in search results by default is very natural.

Actions #11

Updated by Marius BĂLTEANU over 7 years ago

Go MAEDA wrote:

We see issues of subprojects by default in issues page (Default value of Setting.display_subprojects_issues is True). So including issues from subprojects in search results by default is very natural.

Oh, I didn't know that displaying subprojects issues on main projects is configurable (my bad). In this case, I think that it'll be better to rename the option in something like "Include subprojects issues on main projects issues and search by default" and make the patch to take into account the setting. In this way, it'll be consistent in both cases (with option enabled and disabled).

What do you think, Go MAEDA?

Actions #12

Updated by Go MAEDA over 7 years ago

  • Target version deleted (Candidate for next major release)

Marius BALTEANU wrote:

Go MAEDA wrote:

We see issues of subprojects by default in issues page (Default value of Setting.display_subprojects_issues is True). So including issues from subprojects in search results by default is very natural.

In this case, I think that it'll be better to rename the option in something like "Include subprojects issues on main projects issues and search by default" and make the patch to take into account the setting. In this way, it'll be consistent in both cases (with option enabled and disabled).

Absolutely agree. It will be even better.

Actions #13

Updated by Marius BĂLTEANU over 7 years ago

Thanks, I'll update the patch soon.

Actions #14

Updated by Marius BĂLTEANU over 7 years ago

Here it is the updated patch: 9909_default_search_scope_v2.patch

Actions #15

Updated by Go MAEDA over 7 years ago

  • Target version set to 3.4.0

The patch 9909_default_search_scope_v2.patch improve usability, and consistensy between search engine and issue tracking. Marius BALTEANU.

Setting target version to 3.4.0.

Actions #16

Updated by Jean-Philippe Lang over 7 years ago

  • Subject changed from set default search scope of a project to Search in project and its subprojects by default
  • Status changed from New to Closed
  • Assignee set to Jean-Philippe Lang
  • Resolution set to Fixed

I've made a simple change to search by default in project and its subprojects. It's based on an helper that can be easily patched, rather than changing the logic in the search controller. Unlike the search engine, the setting is (almost) specific to issues display_subprojects_issues, I prefer not to reuse it in this case. If it's needed, we'll add a specific setting for the default search scope.

Actions #17

Updated by Mischa The Evil over 7 years ago

  • Has duplicate Feature #22125: Make Search default to current project and sub projects added
Actions #18

Updated by Marius BĂLTEANU over 6 years ago

Actions #19

Updated by Go MAEDA over 5 years ago

  • Related to Defect #30923: Project search should select subprojects scope when the project has subprojects added
Actions

Also available in: Atom PDF