Title search not working as expected

Starting this afternoon, our search function has changed in some way.
forum

We have several titles that we add to frequently and so we use the search quite heavily. Until this afternoon, when we searched for a title and then clicked on it, it would take us to the first post of the thread.

Now it’s taking us to some random place in that thread.

Example: Searching for “Black Clover” in the search and clicking on it takes us to (approximately) post 230 of 463.
Searching for “Dragon Ball” takes us to (approximately) post 817 of 1101.

The first post has the name in it as well as several dozen posts before the post it’s taking us to.

Ideally, we want it to take us to the first post and only as a second choice would we want it to take us to the last post in the thread. Definitely not somewhere in the middle of the thread.

3 Likes

Two things may be happening:

  1. Discourse tracks read status, taking the user back to where they were in the thread.
  2. Search results are finding a specific reply to be more relevant, linking directly

I’m not sure of a setting that would make it differently suddenly, nor of a recent change, others may know. :slight_smile:

I was in these threads yesterday and was posting at the end. Have been through them all several times front to back.

I guess I don’t understand this since almost 90% of the posts have the search words in it, including the first post which usually has it multiple times.

1 Like

We have done some internal tuning to our search engine, @tgxworld will follow up here.

4 Likes

So what @maiki said here is correct and is actually the behavior that we want when search results are ordered by relevance. However, we had a bug in our code previously where we would only show either the earliest post or latest post of a topic that matches the given term.

This can still be achieved with the in:first filter.

Something definitely seems to be off with the search results here because I can definitely find other posts which I think should be ranked higher. Let me investigate.

3 Likes

@Slowhand There was indeed a bug where we were not showing the actual post with the highest rank.

Searching for Black clover will take you to Black Clover - Other Anime - AN Forums while searching for Dragon ball will take you to Dragon Ball (all series & movies) - Other Anime - AN Forums now.

3 Likes

Thank you for looking into this. My belief is that if what I’m searching for is the actual title of the thread, then it should take me to the first post; not some post that the system thinks is “relevant”. What the system believes is relevant probably has little to do with how we actually use our forum.

This reminds me of Twitter that keeps switching my mode to “Top Tweets” instead of “Most Recent Tweets”. Who want to read tweets in some random order instead of how they happen. (sorry for the off-topic rant)

1 Like

Do you know of the in:title operator? This will certainly always take you to post #1.

No, I do not.

(need 20 characters, so filler)

Give it a shot, it is super useful

1 Like

I used it and while I only get one search result, when I click on the thread, it still takes me to a random point in the thread.

Searched “Black Clover in:title” and it took me to Post 103 of 463.

1 Like

Oh that is certainly a bug and @tgxworld will get it fixed shortly! in:title should take you unconditionally to post #1.

2 Likes

Thanks so much!
And I really appreciate the tip for in:title searching, I’ll definitely be using this from now on.

1 Like

Fixed in

https://github.com/discourse/discourse/commit/af8791117896d664830dfce4957f4fe52dbfe941

5 Likes

This works great, again thank you so much!

3 Likes