# Search Priority for Categories don't work with empty search query?

**URL:** https://meta.discourse.org/t/search-priority-for-categories-dont-work-with-empty-search-query/143642
**Category:** Bug
**Tags:** pr-welcome
**Created:** [March 8, 2020, 8:53am UTC](https://meta.discourse.org/t/search-priority-for-categories-dont-work-with-empty-search-query/143642 "2020-03-08T08:53:14Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![GokulNC](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gokulnc/32/182419_2.png) [@GokulNC](https://meta.discourse.org/u/GokulNC)
#### Post date: [March 8, 2020, 8:53am UTC](https://meta.discourse.org/t/search-priority-for-categories-dont-work-with-empty-search-query/143642/1 "2020-03-08T08:53:14Z")

</div>

**The story:**  
I have created a page called `No Replies` for my forum with the following URL:  
[\<discourse\_forum\>/search?q=status%3Asingle\_user%20in%3Aunsolved%20status%3Aopen%20order%3Alatest\_topic](https://meta.discourse.org/search?q=status%3Asingle_user%20in%3Aunsolved%20status%3Aopen%20order%3Alatest_topic)

What this does is creates an empty search query with the following advanced search parameters:

> status:single\_user in:unsolved status:open order:latest\_topic

Essentially, it’s used to find out the unsolved topics for which no one has replied. (so that we can attend those on priority)

**What’s wrong with it?:**  
There are some categories like `News`, `Announcements`, etc. where having a post with no replies is totally fine. But they show up in the above search.

**What I tried:**  
For the categories mentioned above (where `no replies` are not to be taken serious), I [set the `Search Priority`](https://meta.discourse.org/t/search-improvements-in-2-3/113411) for those categories as `Very Low`, so that they could appear in the last during the search.

But it doesn’t seem to happen. Even when I sort the search results by `Relevance`, they still show up at with the top ones.  
 ![image](https://global.discourse-cdn.com/meta/original/3X/3/7/371719a2f16872f61df99ff99bd7b5954c94dcfc.png)

Only when I set the `Search Priority` as `Ignore` for those categories, the search prioritization seems to work (that is, those topics from `ignored` categories disappear)

Can someone please explain the prioritization behavior? (with empty search query)  
And a solution to ensure `Low Priority` category topics always go to the bottom?

Note: If this is not a `bug`, please feel free to move it to the relevant category.

---

<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: [March 9, 2020, 7:34am UTC](https://meta.discourse.org/t/search-priority-for-categories-dont-work-with-empty-search-query/143642/2 "2020-03-09T07:34:31Z")

</div>

Border line bug/feature, I support cleaning this up, we don’t apply the priority in this case cause it is applied later when we search for stuff. You don’t have a way of searching for nothing.

Putting #pr-welcome on this

---

<div class="post-metadata">

### Author: ![blueworrybear](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/blueworrybear/32/177825_2.png) [@blueworrybear](https://meta.discourse.org/u/blueworrybear)
#### Post date: [April 22, 2020, 3:54pm UTC](https://meta.discourse.org/t/search-priority-for-categories-dont-work-with-empty-search-query/143642/3 "2020-04-22T15:54:40Z")

</div>

Hi, I am interesting in this issue. I have created a pull request on Github.

The update will apply category search priority with:

1. Empty query string and
2. No specified order

PR in place: [FIX: Apply category priority for empty query #9516](https://github.com/discourse/discourse/pull/9516)

---

<div class="post-metadata">

### Author: ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)
#### Post date: [May 11, 2020, 4:56am UTC](https://meta.discourse.org/t/search-priority-for-categories-dont-work-with-empty-search-query/143642/4 "2020-05-11T04:56:44Z")

</div>

PR was merged a few weeks ago.

---

<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: [May 11, 2020, 6:50am UTC](https://meta.discourse.org/t/search-priority-for-categories-dont-work-with-empty-search-query/143642/5 "2020-05-11T06:50:54Z")

</div>


