Feature #5840

Live lookup of the existing issues based on the keywords entered in the title for new issue

Added by Andrius Kriučkovas over 7 years ago. Updated over 2 years ago.

Status:NewStart date:2010-07-08
Priority:NormalDue date:
Assignee:-% Done:

50%

Category:UI
Target version:Unplanned
Resolution:

Description

It would be good benefit for duplicate issue evasion, to have live look-up of the existing issues based on the keywords entered in the title. Simply, as you enter the keywords in the title of a new issue, system scans DB for any issues and offers for example up to 5 top-related issues, which have most of the keywords in the title. This would greatly improve duplication problem, albeit putting strain on the server. This feature should not try to look-up on any character change in the title, but only after the full word is entered and space symbol following it.

Capture.PNG (14.8 KB) Andrew Betts, 2011-01-26 21:38

dups.js (2.32 KB) Dustin Lambert, 2011-02-07 22:04

ro5840-integrate_dups_js_by_dustin_lambert-trunk_r7885.patch Magnifier - Patch created against trunk @ r7885. (2.9 KB) Mischa The Evil, 2011-11-24 22:20


Related issues

Related to Redmine - Feature #9180: Improve search system for issues - like "context specific... New 2011-09-04
Related to Redmine - Feature #5492: Issues should implement acts_as_ferret New 2010-05-10
Related to Redmine - Feature #5470: Avoid duplicate issue creation New 2010-05-07
Duplicated by Redmine - Feature #5859: Search for similiar tickets when creating a new one Closed 2010-07-09
Duplicated by Redmine - Feature #9642: Duplicate issue search on new issue submit Closed 2011-11-23
Duplicated by Redmine - Feature #12240: Check for duplicate/related tickets before submitting Closed

History

#1 Updated by Aron Rotteveel over 7 years ago

+1. Would love to see a feature like this.

#2 Updated by Felix Schäfer over 7 years ago

  • Category changed from Search engine to UI

This should be a breeze to throw in once we have a unified autocomplete mechanism. What do you propose should happen on clicking on the matched issues?

#3 Updated by Andrius Kriučkovas over 7 years ago

Felix Schäfer wrote:

This should be a breeze to throw in once we have a unified autocomplete mechanism.

Sorry, I am not familiar with the development roadmap, therefore, I cannot comment on the architecture.

What do you propose should happen on clicking on the matched issues?

I think, if the mouse-cursor over of those top-5 issues, should show the header of the problem on the pop-up section (or whatever it is in the HTML terms) with the main description.

And clicking it - go directly to the old issue, instead of post new one. We encourage the users to search for old issues, and reopen them, but this is not trivial and requires active involvement. Such feature would kill the issue in a smart way.

#4 Updated by Andrew Betts almost 7 years ago

This would be very useful for us as well. Our Redmine users include our clients as well as our development team and on commercial projects you cannot demand that a client go out of their way to try and find out whether the issue they've observed has already been reported in the same way that you might expect an open source user to. The particular case I'm thinking of is a client that has small offices in five locations around the world. The staff don't regularly see each other and are incredibly busy so collaboration on issue tracking is currently virtually non-existent.

Having the ability to pro-actively let them know that the issue they're raising has already been reported, and giving them a link to it, would save a lot of time and improve communication and co-ordination, particularly over urgent issues.

#5 Updated by Andrew Betts over 6 years ago

I've solved this for us with a bit of jQuery. This clearly isn't the way you'd do it ideally, but I'm a JS developer, and I don't know any Ruby :-)

// When new issues are created, search Redmine for similar issues
var timSearchSimilar = null;
$('.new-issue-form #issue_subject').attr('autocomplete', 'off').bind('keyup change', function() {
var txtEl = $(this);
clearTimeout(timSearchSimilar);
timSearchSimilar = setTimeout(function() {
var proj = location.href.replace(/^.*\/projects\/([^\/]+)\/issues.*$/, '$1');
$.get('/search/index/'+proj+'?issues=1&q='+escape(txtEl.val()), function(resp) {
var pat = new RegExp(/&lt;a href=\"\/issues\/(\d+)\"&gt;(.*?) #(\d+) \(([^\)]+)\)\: (.+?)<\/a>/gi);
var result;
var similarhtml = '';
while ((result = pat.exec(resp)) != null) {
similarhtml = "&lt;tr&gt;&lt;td&gt;"+result[2]"&lt;/td&gt;&lt;td&gt;&lt;a href='/issues/"+result[1]+"'&gt;#"+result[1]+"&lt;/a&gt;&lt;/td&gt;&lt;td&gt;"+result[5]+"&lt;/td&gt;&lt;td&gt;"+result[4]+"&lt;/td&gt;&lt;/tr&gt;";
}
if ($('#similarissues').length) $('#similarissues').remove();
if (similarhtml) {
similarhtml = "&lt;div id='similarissues' style='padding: 5px 0 8px 180px;'&gt;&lt;label&gt;Did you mean?&lt;br&gt;&lt;span style='font-size:10px; line-height: normal; font-weight: normal'&gt;These issues already exist&lt;/span&gt;&lt;/label&gt;&lt;table style='line-height: 1em'&gt;"+similarhtml+"&lt;/table&gt;&lt;/div&gt;";
$('#parent_issue').before(similarhtml);
}
})
}, 500);
});

I hope this is of some use to people who want this feature until it's available in Redmine itself.

Result looks like this:

#6 Updated by Andrew Betts over 6 years ago

Note that in my previous comment, the JS code doesn't have any HTML entities in it, so convert those back to angle brackets for the real code.

#7 Updated by Dustin Lambert over 6 years ago

I like Andrew's solution, but in the spirit of Prototype, I've translated his solution to Prototype. It should work with Redmine out of the box as a plugin.

Also changed a few things (I hope):
  • Changed regular expression to handle Redmine being installed to a sub directory
  • Open links in new windows
  • Tracker Type and Issue Number are all linked now

Hope this helps!

#8 Updated by Anonymous over 6 years ago

Where do i have to put the dups.js? How do i integrate it into redmine?
Thanks in advance

#9 Updated by Andrius Kriučkovas over 6 years ago

  • % Done changed from 10 to 50

Would it be possible to release this into mainline and/or as plug-in? From end-user POV, there is lack of install instructions.

#10 Updated by David B almost 6 years ago

+1 I want this too!

#11 Updated by Etienne Massip almost 6 years ago

  • Target version set to Candidate for next major release

#12 Updated by Terence Mill almost 6 years ago

+1

#13 Updated by Mischa The Evil almost 6 years ago

I've created a simple patch file to integrate the dups.js contributed by Dustin Lambert within the core. I haven't touched the javascript but it seems to work without any problems (haven't tested it thoroughly though).

The here provided implementation can also be provided through a plugin pretty easily. I think the following two topics should be covered now:
  1. We should reach consensus about if this should be integrated within the Redmine core or through a third-party Redmine plugin (unless this is already decided by the committers, considering the target-version)
  2. If the decision is made to integrate this as a core feature, I'd prefer to have an option to enable/disable this feature preferably at project level but at least at application level. Any opinions?

#14 Updated by Jean-Philippe Lang almost 6 years ago

  • Target version changed from Candidate for next major release to Unplanned

I'm not sure that this should be in the core. The proposed dup.js seems more like a hack to me but can easily be added via a plugin.

#15 Updated by Jean-Philippe Lang almost 6 years ago

BTW, to make this script more robust, the core could provide json/xml response for search results.

#16 Updated by Andrius Kriučkovas almost 6 years ago

Jean-Philippe Lang wrote:

I'm not sure that this should be in the core. The proposed dup.js seems more like a hack to me but can easily be added via a plugin.

Dear Jean. From the support point of view, the plug-in is worse. For example in Lithuania, many supporters of the Redmine decline to mess up with the plugins, especially if they lag-behind the upgrade cycle/version. I would like it to suggest to be a core feature, because it truly think, that this would have a very positive impact of the real implementations in the field - both for knowledge search and duplication evasion.

Of course the impact on the DB and server-side resources should be accounted for, but I think this is not an issue any more because of move to 64 bits/more RAM, many-cores, etc.

#17 Updated by Andrius Kriučkovas almost 6 years ago

One more thing - there is an issue with the languages for example (Lithuanian), which have many suffixes, endings, and which are not only root-based (as English is). Declensions and conjugations does have impact.

I think I should update initial report, that the system should try to look-up after N (configurable via settings) symbols are entered and after space (or short pause after last input character). This would almost solve such language issues.

#18 Updated by Jean-Philippe Lang almost 6 years ago

Vasaris Vėjas wrote:

From the support point of view, the plug-in is worse.

I understand but I simply can't put all the existing plugins in the core.

I think I should update initial report, that the system should try to look-up after N (configurable via settings) symbols are entered and after space (or short pause after last input character). This would almost solve such language issues.

That's the point that makes this feature not so easy to make it really usefull. This could work if it relies on a smarter full text search engine (eg. tsearch for pg).

#19 Updated by Andrius Kriučkovas almost 6 years ago

Jean-Philippe Lang wrote:

Vasaris Vėjas wrote:

From the support point of view, the plug-in is worse.

I understand but I simply can't put all the existing plugins in the core.

At least for now I hope ;-)

That's the point that makes this feature not so easy to make it really usefull. This could work if it relies on a smarter full text search engine (eg. tsearch for pg).

I do agree, that this is not obviously a killer-feature. But I do hope, that in time it will make to a supported plug-in or core. My point was, that even not a perfect solution (80%:20%) if looked from the end-user/supporting admin (not developer's!) position would be useful. At least a candidate for a consideration ;-).

P.S. By the way I think that most latin-based languages wouldn't have any issues with the simple implementation.

#20 Updated by Alessandro Bahgat over 5 years ago

Hi guys, we started working on a plugin (here https://github.com/abahgat/redmine_didyoumean) to provide this kind of functionality, and I just discovered this issue. We are still experimenting with a few search options in order to return just relevant results and, ideally, we'd love to do it without impacting Redmine's core.

If you want to help with any hint or suggestion, we'd really appreciate that.

#21 Updated by Terence Mill over 4 years ago

+1

Covered by:

Feature #9180- Improve search system for issues - like "context specific search"

#22 Updated by Daniel Felix over 4 years ago

This seems to be covered by http://www.redmine.org/plugins/didyoumean ?

Edit: Haven't seen note 20. :-)
But maybe you could provide this as a corepatch to add this in Redmine core in the future? :-)

#23 Updated by Andrius Kriučkovas over 4 years ago

  • Status changed from New to Resolved

Alessandro Bahgat wrote:

Hi guys, we started working on a plugin (here https://github.com/abahgat/redmine_didyoumean) to provide this kind of functionality, and I just discovered this issue. We are still experimenting with a few search options in order to return just relevant results and, ideally, we'd love to do it without impacting Redmine's core.

If you want to help with any hint or suggestion, we'd really appreciate that.

I have just installed this one, as my scheduled Redmine upgrade sequence. From the first sight, it looks exactly what was needed. Perhaps it would be nice, if Redmine had some search tags infrastructure, so the live lookup would work even for tags/contents of the issue. Because users sometimes are laconic on the subject line ;-)

#24 Updated by Andrius Kriučkovas over 4 years ago

Daniel Felix wrote:

This seems to be covered by http://www.redmine.org/plugins/didyoumean ?

I bet, it is.

Edit: Haven't seen note 20. :-)
But maybe you could provide this as a corepatch to add this in Redmine core in the future? :-)

As plugin install takes ~3 min., it is no longer an issue.

#25 Updated by Etienne Massip over 4 years ago

  • Status changed from Resolved to New

#26 Updated by Jeff Pierson over 4 years ago

+1 This is a feature that Bugzilla had that we appreciated greatly once it was added. We will be soon migrating to Redmine and likewise having duplicate issue detection at some point in the future would be a very welcome feature.

#27 Updated by Jaap de Haan over 2 years ago

+1: StackOverflow has a feature like this and it's really great. Unfortunately not open source so no details on implementation available but that's the way it should work, definitevely :-)

Also available in: Atom PDF