oracle / opengrok

OpenGrok is a fast and usable source code search and cross reference engine, written in Java
http://oracle.github.io/opengrok/
Other
4.36k stars 748 forks source link

short URL for all projects search wanted #1357

Closed ilovemaui closed 5 years ago

ilovemaui commented 7 years ago

so i recently enabled projects in my opengrok instance. but do a search, you need to specify all of them (the url). so perhaps we can add an enhancement/keyword that will let you search all projects.. for example.. i have proj1 proj2 proj3 proj4 proj5 so I have to do a search like this: https://myopengrok/source/search?q=foobar&defs=&refs=&path=&hist=&type=&project=proj1&project=proj2&project=proj3 &project=dpkg&project=proj4&project=proj5

if would be nice if we could have a single keyword that would include all of them. thanks. fyi, this should also be added to command line tool.

tulinkry commented 7 years ago

In the web interface you can hit the "select all" button above the project picker. The selection is stored in a cookie afterwards and then it's selected automatically. It kinda solves the problem in the web interface however there is no special keyword.

vladak commented 7 years ago

So this is asking for something like this:

https://myopengrok/source/search?q=foobar&defs=&refs=&path=&hist=&type=&project=ALL
vladak commented 7 years ago

Related to #1048 in a sense that too many projects make the URL long enough to hit limits.

ilovemaui commented 7 years ago

perhaps something like that.. before, I didn't use projects at all, and we just searched everything anyhow. I am currently hardcoding the list, but this enhancement would make that unnecessary.

tulinkry commented 7 years ago

@vladak I'd suggest a different parameter than "project" as the project name can be arbitrary. Something like this:

https://myopengrok/source/search?q=foobar&defs=&refs=&path=&hist=&type=&search_all=true
ilovemaui commented 7 years ago

additionally, and i don't know if it related. but when you open a browser for the 1st time, there are no projects selects. While it does remember once you put in the projects you want. is there any way to default to include all projects the first time a browser is open?

tulinkry commented 7 years ago

No there is not

ilovemaui commented 7 years ago

ok. thanks. I wasn't sure if this could be a useful enhancement

tulinkry commented 7 years ago

ok. thanks. I wasn't sure if this could be a useful enhancement

By the way this was already suggested a long time ago (#28) and it could be an useful enhancement

adamscybot commented 7 years ago

This is needed. I have 100's of projects and so when I want to share the link with another developer its prohibitively long.

tulinkry commented 7 years ago

Also kinda duplicate of #563

dhireng commented 7 years ago

I updated the code to include a search all projects button. The question is how do i submit a push?

vladak commented 7 years ago

It's easy on github: https://help.github.com/articles/creating-a-pull-request/

dhireng commented 7 years ago

Thanks. I think I did the needful.


From: Vladimir Kotal notifications@github.com Sent: Wednesday, May 31, 2017 6:07 AM To: OpenGrok/OpenGrok Cc: dhireng; Comment Subject: Re: [OpenGrok/OpenGrok] short URL for all projects search wanted (#1357)

It's easy on github: https://help.github.com/articles/creating-a-pull-request/

Creating a pull request - User Documentationhttps://help.github.com/articles/creating-a-pull-request/ help.github.com Create a pull request to propose and collaborate on changes to a repository. These changes are proposed in a branch, which ensures that the master branch only ...

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/OpenGrok/OpenGrok/issues/1357#issuecomment-305093019, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AP9U0a0-QixRlioWWzSlkHrDJpcnZj7qks5r_QOhgaJpZM4LxuT3.

dobrou commented 6 years ago

We run opengrok with ~400 projects and long url is big problem for us too. Now url has about 12kb when I search all projects. This makes links to search results almost unsharable.

However simple solution with one special wildcard for all projects does not seem to be enough. Common use case is to search subset of all projects but still large and we would be back with same issue.

So please take this as another vote and kind request to fix this issue.

dobrou commented 6 years ago

My proposal how the long url issue can be fixed:

1 ) Grouping Projects into Groups As Opengrok already allows administrator to define Groups of Projects in configuration file. List of projects in url will be automatically shrinked into predefined Groups, as much as possible.

Example: Projects: A,B,C,D,E Group: G1 contains Projects A,B Group: G2 contains Projects B,C Group: G3 contains Projects D,E Group: G4 contains Groups G2,G3 Shrinking: {A,C,E} -> {A,C,E} {A,B} -> {G1} {A,B,C} -> {G1,C} {B,C,D,E} -> {G4} {A,B,C,D,E} -> {A,G4} or {all}

Basic algorithm idea:

1a ) Virtual predefined Group for all Improve solution 1) for users not using Groups and for users with large number Groups. Opegrok can define one virtual Group 'all' that will always contain all existing Projects/Groups.

As a result, for users not using Groups, this will work exactly same as one wildcard solution proposed above. And users using Groups will not have to define own 'ALL' groups to enable super short link searching all projects.

2 ) Another small improvement Switch url from ...?project=A&project=B to ...?project=A|B


Another advantage I see in Groups usage in search url is that urls to Opengrok will obsolete slower. If projects are added or removed in Group, current search url fails or does not inlude new Projects. Urls with Groups will adapt automagically.

eh1160 commented 6 years ago

Instead of adding a special case to the project parameter (like ?project=ALL), maybe OpenGrok could search all projects by default if the project parameter is not supplied.

vladak commented 6 years ago

There was PR #1621 opened for this however not touched in a while however maybe some of the work can be leveraged.

falc0nit3 commented 5 years ago

Any update on this? This is a much needed request.

tulinkry commented 5 years ago

no directly, but now it's supported with groups so the url gets a little bit shorter when using groups

tulinkry commented 5 years ago

2518

reflectivist commented 5 years ago

Wish OpenGrok remembered the projects that I have selected to search. When I "select all" and search, I get into a file and click a link (to a function declaration), for example, it seems to default to a more limited set of projects than I selected to search in the first place (in my case, I have 'src' "project" 'include' "project" and so forth), so I'm always having to go back up and click select all again or it will just search the 'include' project, for example. I'd be fine in my case with selecting a default set of projects to search and never having to re-select.

vladak commented 5 years ago

This is different problem than being discussed here - see #1447.

grajsor commented 5 years ago

Why is this closed? Using groups is not an option when you have 1200 different repos automatically imported. This is still very much a huge problem...

tulinkry commented 5 years ago

I don't see this being closed.

dhireng commented 5 years ago

I submitted a PR but for one reason or the other it was getting pushed back. I now maintain my own forked repository. Also note that the projects dropdown is gets super slow when you have a couple of 100 projects. It will be best if the right design is agreed - the coding aspect takes no time.

vladak commented 5 years ago

PR #1621 was closed due to lack of response to review comments as far as I know. Also, adding new UI elements is pretty much deal breaker.

grajsor commented 5 years ago

Question is if adding a UI-element is as bad as having a broken application for the past 6 months... It's starting to get quite annoying...

vladak commented 5 years ago

The PRs needs to meet some quality threshold, otherwise the project would be hard to maintain. This was not as much about the UI element, rather it was the lack of response. If this is so important, someone else would step up with its own PR I guess.