48

Edit: Shog9 already acknowledged this issue in a comment where he referenced Help us find duplicates efficiently on meta SE. Since that post is about 10 months old and nothing was changed, I'm skeptical about a future fix, but I see no reason not to try.

I believe that the search field used when selecting a duplicate can have its functionality improved. It is definitely not the same as the site search, judging by the different results they give.

As an example, I voted to close Type The nested type CubeRanks cannot hide an enclosing type as a duplicate of nested type cannot hide an enclosing type. To speed up the process, I typed in the target question's title. Here are some screenshots of the process:

enter image description here

Alright, I didn't supply a lot of information yet, but at least use the tags in the question I'm closing: and (this one is completely unrelated to the question). Instead, I get and , and , and and , and and and etc.

Continuing,

enter image description here

What?

nested type cannot hide an en == PrimeFaces commandButton actionListener not firing ???

Not only that question is not tagged similarly, the words "nested" or "hide" do not even appear on that page. Where did all the questions go? Surely the target question I'm searching for should appear.

Continuing,

enter image description here

Do I really need to spell it out (literally)? If I'm missing the final letter of the title then I get no matches (when such a message appear, the previous search results are left, they don't indicate anything about the current search).

To be fair, the question does pop-up intermittently while typing, but not so often in the 4 visible candidates.

Apparently, I'm not the only one suffering from this. I'm going to call this a bug because of the "blatant incompetence" displayed, but if this is by-design for some reason, then do make it a feature request.

Edit 2: to all the users who post suggestions in the comments: please post them as answers. Telling me ideas in the comments won't help, I'll just say "go for it".

16
  • 1
    Ugh we suffer from similar bugs - elasticsearch isn't easy.
    – JonH
    Commented Feb 11, 2016 at 17:14
  • @JonH Agreed, but they already have a search that would have given better hits - the "regular" site search. Commented Feb 11, 2016 at 17:18
  • 1
    True I just wanted to vent about elasticsearch.
    – JonH
    Commented Feb 11, 2016 at 17:19
  • Perhaps elasticsearch should be removed and replaced.
    – Travis J
    Commented Feb 11, 2016 at 19:37
  • 11
    I'd extend this to "Improve search, in general". Search kinda sucks, and not just the duplicate box one. Commented Feb 11, 2016 at 21:04
  • 6
    I think that even a site:stackoverflow.com link to Google would yield more accurate results (but of course that would not integrate as nicely). Commented Feb 12, 2016 at 10:09
  • 3
    The only search that is truly awesome is the search for existing questions when asking. That one is really good. Can we have that everywhere?
    – usr
    Commented Feb 12, 2016 at 13:26
  • 9
    When I want to find an answer to a programming issue I use Google. A relevant Stack Overflow or related SE site is usually in the top three hits. Sadly the same cannot be said of searching within Stack Overflow.
    – kevinskio
    Commented Feb 12, 2016 at 13:44
  • All that's really needed is "plug the duplicate search into the same engine as the site search", with added bonus of pulling tags from the question as a default search term perhaps (like how on Profile pages the search box gets the current user as a default) Commented Feb 12, 2016 at 13:56
  • 2
    @JonasCz I can't change my question to suit every user's comments and not after people have voted. I strongly suggest that you write an answer with your input and suggestions. Not only do you have strong support in the comments, this meta post is still in the "Hot Meta" questions and your ideas will gain decent exposure. Strike while the iron is still hot. Commented Feb 12, 2016 at 14:01
  • @usr Why are you asking me? I would say "sure". I suggest that you post an answer with your suggestions. See my comment above to JonasCz. Commented Feb 12, 2016 at 14:02
  • @NiettheDarkAbsol You have my blessing. See my above comments. Commented Feb 12, 2016 at 14:03
  • Wow it really is that bad. Commented Feb 12, 2016 at 21:43
  • If you already know the URL of the question you are searching for (as in your example), you can just paste the URL in the box and it will bring up the correct result. But I agree the search should be improved for the times where you just vaguely remember a question has been answered before. Commented Feb 14, 2016 at 1:23
  • @three_pineapples That's what everyone does. They Google for the answer and then copy-paste the URL. The thing is, that field you type into is not just a form field, it's also a search field, and it fails at that. Commented Feb 14, 2016 at 2:00

3 Answers 3

5

The search should be better at locating canonical questions. Someone who uses this feature already strongly suspects the question is a duplicate of an existing question. Unless they have a prodigious memory, this must be because the question is a duplicate of a FAQ with a canonical question. Perhaps it should be biased towards FAQs (questions with many links, I think), highly up voted questions, and protected questions.

I suspect the search engine can not do such biasing itself. Perhaps it could be done in a post processing stage. As using that search functionality is a privilege, it might be sheltered from the DoS danger of such post processing being generally applied.

5

This is still an issue in February 2022.

If I put [java] compare string into the site search, I see the specific canonical question I had in mind (rather, the top answer for that) listed second.

If I put it into a search engine and ask it to search Stack Overflow specifically, the desired question comes up first (DDG is not supposed to customize search results, but I also tested in an incognito window to make sure).

If I put the same thing into the search embedded into the duplicate closure search, the desired result does not appear at all, and most of the results are irrelevant garbage. The highly-upvoted answers are answering more sophisticated questions, and distributed seemingly randomly throughout. I assume the algorithm is trying to sort these results by "relevance", but it misses the mark catastrophically.

Writing compare strings instead seems to fix the problem, but I can't be sure whether this is because the search is somehow training itself on all the other attempts I made to try to get reproducible and correct behaviour.

Please do something. Literally cloning the routine that is used to search the site normally would give better results. I don't have any idea what it's actually doing, but it evidently doesn't do that. If it's trying to take into account some kind of machine-learned context clues from the question, it has a net negative effect.

Better yet, let us search within our bookmarks explicitly. That way, the bookmark functionality could actually become something approaching useful, especially for those of us who wield dupe hammers. Even better, let us give those bookmarks our own private, searchable tags. Then we could actually build up a personal library of canonical duplicates to refer to.

1
4

Agreed. I am not that great with these type of questions but I will try my best.

First step: Find all questions will related badges

That should be simple. Duplicate questions should have most if not all of the tags the question in question has. There should be a very close relationship between the tags, like and . Tags that simply don't mix won't make the list unless there are other tags that match.

Second step: Keywords

Find the words used in the question itself with others filtered by the above step. Like in your example, the filter should try matching important phrases or words like nested type and en. All the other words are irrelevant and will make the search even worse.

Third step: Closeness of title

Come on, at least check if the title seems to have the same meaning of the other questions. Clearly, the examples you gave should give way better results and typing in the question word for word will be painful. If the title has a close relationship with other titles, use them. Why is str() giving me an error and Why is using str() raising an error is an example of closeness. Seemingly, slight differentiation of the wording will cause chaos.

Fourth step: Questions others are commonly marked duplicate as

If there is a type of question usually that makes a lot more questions closed as duplicate, try those as well.


Order of steps may vary and I probably skipped some major steps but this is my idea.

3
  • python import * would get you decorators and iterators. Not exactly wildcards like you would expect.
    – Zizouz212
    Commented Feb 12, 2016 at 22:36
  • 2
    ".. other words are irrelevant ..": using a common stop word list will remove and and or, common operators that one might want to ask on (or for or while). Oh wait – just tested and looking for and already returns nothing particularly useful (for example, it sees the "and" in "Confused with network byte order and host byte order"). Oh well then go ahead. Any change may make it work better.
    – Jongware
    Commented Feb 12, 2016 at 23:24
  • 3
    I don't know if the above is the best way to address the problem (or even if it's appreciably different from the current algorithm). But I agree something like this seems like the right thing to do. I am getting sick and tired of typing "what is nullreferenceexception and how do I fix it?", only for the search in the close-as-duplicate window to find some SQL post as the first search hit, and the post with the exact text I typed as the second one. Grrrr... Commented Feb 13, 2016 at 5:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .