هل يمكنني استبعاد أسماء المستخدمين من البحث

Is there a way to remove a specific user’s posts from the search results? Currently, if a highly active user has a username that starts with or otherwise includes a popular term in a community such as…

Search term: ‘ABCD’
Username: ‘ABCDAndUser…’

…Searching said term often brings up a list of the username’s posts, to the point where it can be near impossible to differentiate results of that user’s random posts from ones that are actually on-topic and simply include that user in the discussion. Ideally, most members would desire a list of on-topic posts over ones that only include said user posting without the term in active use.

Edit: Currently I’m not aware of a workaround for this other than changing said username and/or users blocking said username while conducting their search. Neither of these are ideal.

3 إعجابات

Oh, wow. Is it actually bringing up posts just made by that person, or is it posts which have replies which literally include their username?

إعجابَين (2)

Ahh good point. On closer inspection, it’s posts which have replies that literally include their username.

إعجابَين (2)

It does seem like there must be some possible enhancement there — it doesn’t seem right that a name can “hijack” a search like that, and it seems likely that people might pick usernames related to any given forum’s particular topic.

I don’t know how hard this would be under the hood, but it might be good to surpress usernames unless the @ is there.

إعجابَين (2)

This is one of the reasons reserved usernames exist.

As standard, Discourse blocks the following:

Nobody wants a user called discourse confusing the discussion.

Communities can update this list to add any terms which are specific to their discussion.

3 إعجابات

I don’t think that’s the best solution for this problem. For example, I can imagine on a car forum someone having a username proclaiming that they own or love some car model. Would you really want ban that possibility — or maintain the list?

Also, once I had to ask a support question of AT&T, and I was unable to use the name “Matthew”. Want to guess why?

إعجابَين (2)

Maybe I misunderstand the setting as stated. Would you have to reserve every instance of any potentially problematic word in future usernames and retroactively remove it from community members’ usernames as well?

I know for a fact we have members that use the name ‘testuser’ for instance. I.E this only would work as a solution if we used wildcards to ban usernames en masse, no? That seems like it could easily become overbearing across numerous abbreviations (this particular instance was an ETF ticker in a finance community).

إعجاب واحد (1)

Also as a practical matter, the username restriction does not work well with SSO. With that, if the SSO does not enforce the same restriction and the user unwittingly chooses a “banned” name, Discourse will assign them a random long uuid-like username.

إعجاب واحد (1)

As a concrete example I am guessing

  1. a user called themselves msft_2000
  2. Now every time someone says “What @msft_2000 says” or “what msft_2000 says” this shows up in search

I am honestly not sure what the right thing is to do, I would probably approach this in the reverse direction.

  • Some special plugin that turns MSFT → “magical msft onebox with extra data”
  • Parse search queries for known stock tickers and do a transform on the search query.

It is certainly going to be very complicated and costly. Only simple workaround I can think of is renaming users.

إعجاب واحد (1)

Is there a specific reason Discourse doesn’t mimic the Google minus sign to exclude search results containing a term (or in this case a username as a term to exclude) from a search? I think that would have been the simplest workaround if it existed.

Sorry, I need this conversation grounded.

You are saying you would like to search for:

msft -msft_user

This is technically possible in our current index, but would require a bunch of work to get it going. Especially since msft_user gets tokenized down to two tokens (msft / user) so we would need to use the is followed by syntax. I can see the merit of implementing a - operator but it is not a trivial change.

3 إعجابات

Yes, apologies if this got too long in the tooth. That was certainly not my intention.

I figured I would ask after one of our members brought up this situation, since it seemed like a fitting change when your team was just recently working on improvements to the search.

This answers the query. :+1:

إعجابَين (2)

No problems at all, I think it is a perfectly legitimate request, supporting -something and -"some longer phrase" could be quite useful in all sorts of cases.

It is not a trivial change, but also it is not an enormous piece of work, the main thing about this change is that it is a bit fiddly.

I am tagging this and next round of work on search we can revisit!

Thanks heaps for raising this.

7 إعجابات

Isn’t this also just a good use case for tags?

excluding tags is supported though:

-tags:bug+feature: excluding topics tagged bug and feature
-tags:bug,feature: excluding topics tagged bug or feature

5 إعجابات