# Title search not working as expected

**URL:** https://meta.discourse.org/t/title-search-not-working-as-expected/157737
**Category:** Support
**Created:** [July 14, 2020, 7:22pm UTC](https://meta.discourse.org/t/title-search-not-working-as-expected/157737 "2020-07-14T19:22:29Z")
**Posts on this page:** 16
**Page:** 1

<div class="post-metadata">

### Author: ![Slowhand](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/slowhand/32/57436_2.png) [@Slowhand](https://meta.discourse.org/u/Slowhand)
#### Post date: [July 14, 2020, 7:22pm UTC](https://meta.discourse.org/t/title-search-not-working-as-expected/157737/1 "2020-07-14T19:22:29Z")

</div>

Starting this afternoon, our search function has changed in some way.  
[forum](https://forums.theanimenetwork.com/)

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.

---

<div class="post-metadata">

### Author: ![maiki](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/maiki/32/233950_2.png) [@maiki](https://meta.discourse.org/u/maiki)
#### Post date: [July 14, 2020, 7:44pm UTC](https://meta.discourse.org/t/title-search-not-working-as-expected/157737/2 "2020-07-14T19:44:19Z")

</div>

> [@Slowhand](#):
>
> Definitely not somewhere in the middle of the thread.

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. 🙂

---

<div class="post-metadata">

### Author: ![Slowhand](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/slowhand/32/57436_2.png) [@Slowhand](https://meta.discourse.org/u/Slowhand)
#### Post date: [July 14, 2020, 7:47pm UTC](https://meta.discourse.org/t/title-search-not-working-as-expected/157737/3 "2020-07-14T19:47:01Z")

</div>

> [@maiki](#):
>
> 1. Discourse tracks read status, taking the user back to where they were in the thread.

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

> [@](#):
>
> 1. Search results are finding a _specific_ reply to be more relevant, linking directly

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.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [July 15, 2020, 12:01am UTC](https://meta.discourse.org/t/title-search-not-working-as-expected/157737/6 "2020-07-15T00:01:42Z")

</div>

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

---

<div class="post-metadata">

### Author: ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)
#### Post date: [July 15, 2020, 2:21am UTC](https://meta.discourse.org/t/title-search-not-working-as-expected/157737/7 "2020-07-15T02:21:28Z")

</div>

> [@maiki](#):
>
> Search results are finding a _specific_ reply to be more relevant, linking directly

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.

> [@Slowhand](#):
>
> Ideally, we want it to take us to the first post

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

> [@Slowhand](#):
>
> Searching for “Dragon Ball” takes us to (approximately) post 817 of 1101.

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.

---

<div class="post-metadata">

### Author: ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)
#### Post date: [July 15, 2020, 6:46am UTC](https://meta.discourse.org/t/title-search-not-working-as-expected/157737/8 "2020-07-15T06:46:22Z")

</div>

@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 [https://forums.theanimenetwork.com/t/black-clover/10507/98](https://forums.theanimenetwork.com/t/black-clover/10507/98) while searching for `Dragon ball` will take you to [https://forums.theanimenetwork.com/t/dragon-ball-all-series-movies/2155/2](https://forums.theanimenetwork.com/t/dragon-ball-all-series-movies/2155/2) now.

---

<div class="post-metadata">

### Author: ![Slowhand](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/slowhand/32/57436_2.png) [@Slowhand](https://meta.discourse.org/u/Slowhand)
#### Post date: [July 15, 2020, 10:12am UTC](https://meta.discourse.org/t/title-search-not-working-as-expected/157737/9 "2020-07-15T10:12:43Z")

</div>

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)

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [July 16, 2020, 12:37am UTC](https://meta.discourse.org/t/title-search-not-working-as-expected/157737/10 "2020-07-16T00:37:39Z")

</div>

> [@Slowhand](#):
>
> what I’m searching for is the **actual title**

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

---

<div class="post-metadata">

### Author: ![Slowhand](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/slowhand/32/57436_2.png) [@Slowhand](https://meta.discourse.org/u/Slowhand)
#### Post date: [July 16, 2020, 1:08am UTC](https://meta.discourse.org/t/title-search-not-working-as-expected/157737/11 "2020-07-16T01:08:44Z")

</div>

> [@sam](#):
>
> Do you know of the `in:title` operator?

No, I do not.

(need 20 characters, so filler)

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [July 16, 2020, 1:13am UTC](https://meta.discourse.org/t/title-search-not-working-as-expected/157737/12 "2020-07-16T01:13:22Z")

</div>

Give it a shot, it is super useful

 ![image](https://global.discourse-cdn.com/meta/original/3X/e/9/e9c2c68524e96bd9d2c5c475a4392aa21b53b255.png)

---

<div class="post-metadata">

### Author: ![Slowhand](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/slowhand/32/57436_2.png) [@Slowhand](https://meta.discourse.org/u/Slowhand)
#### Post date: [July 16, 2020, 1:15am UTC](https://meta.discourse.org/t/title-search-not-working-as-expected/157737/13 "2020-07-16T01:15:38Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [July 16, 2020, 1:17am UTC](https://meta.discourse.org/t/title-search-not-working-as-expected/157737/14 "2020-07-16T01:17:45Z")

</div>

> [@Slowhand](#):
>
> 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.

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

---

<div class="post-metadata">

### Author: ![Slowhand](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/slowhand/32/57436_2.png) [@Slowhand](https://meta.discourse.org/u/Slowhand)
#### Post date: [July 16, 2020, 1:28am UTC](https://meta.discourse.org/t/title-search-not-working-as-expected/157737/16 "2020-07-16T01:28:59Z")

</div>

> [@sam](#):
>
> in:title should take you unconditionally to post #1.

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

---

<div class="post-metadata">

### Author: ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)
#### Post date: [July 16, 2020, 4:23am UTC](https://meta.discourse.org/t/title-search-not-working-as-expected/157737/17 "2020-07-16T04:23:41Z")

</div>

Fixed in

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

---

<div class="post-metadata">

### Author: ![Slowhand](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/slowhand/32/57436_2.png) [@Slowhand](https://meta.discourse.org/u/Slowhand)
#### Post date: [July 16, 2020, 5:03pm UTC](https://meta.discourse.org/t/title-search-not-working-as-expected/157737/18 "2020-07-16T17:03:33Z")

</div>

This works great, again thank you so much!

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [July 16, 2020, 5:08pm UTC](https://meta.discourse.org/t/title-search-not-working-as-expected/157737/19 "2020-07-16T17:08:30Z")

</div>


