# Maximum Number of Search Results?

**URL:** https://meta.discourse.org/t/maximum-number-of-search-results/73683
**Category:** Support
**Created:** [8 november 2017 om 12:14 UTC](https://meta.discourse.org/t/maximum-number-of-search-results/73683 "2017-11-08T12:14:48Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![RobMeade](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/robmeade/32/109119_2.png) [@RobMeade](https://meta.discourse.org/u/RobMeade)
#### Post date: [8 november 2017 om 12:14 UTC](https://meta.discourse.org/t/maximum-number-of-search-results/73683/1 "2017-11-08T12:14:48Z")

</div>

Hi,

Just wondered whether there is a maximum number of search results being set in the background of Discourse at all?

I wanted to see how many of the automated topics we have that are created have any responses, I found 305 that do not, but I wanted to find the total number of the automated posts (they all begin with the same text). After scrolling for some time, no more were loaded and the count was exactly 500 - this felt too _neat_ to be by chance.

I’ve looked through the admin settings for both “search” and “500” and I didn’t see anything which looked like a limit on the number of returned results.

Any information would be appreciated 🙂

---

<div class="post-metadata">

### Author: ![HAWK](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hawk/32/86627_2.png) [@HAWK](https://meta.discourse.org/u/HAWK)
#### Post date: [8 november 2017 om 17:16 UTC](https://meta.discourse.org/t/maximum-number-of-search-results/73683/2 "2017-11-08T17:16:10Z")

</div>

Yup, it’s capped at 500 🙂

> [@Search Results Limited to 50 each time](https://meta.discourse.org/t/search-results-limited-to-50-each-time/34270/12):
>
> Here is the pull request resolving this issue: [FIX: limited search results by dmacjam · Pull Request #4981 · discourse/discourse · GitHub](https://github.com/discourse/discourse/pull/4981) - added infinite loading of search results, in total 10 pages of 50 results are loaded when scrolling which results in 500 search results (not more because of the performance, even Google limits maximum 1000 results per query). If there are still more results, it tells users to narrow down their search criteria. Any comments and suggestions are welcome.

---

<div class="post-metadata">

### Author: ![RobMeade](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/robmeade/32/109119_2.png) [@RobMeade](https://meta.discourse.org/u/RobMeade)
#### Post date: [8 november 2017 om 19:43 UTC](https://meta.discourse.org/t/maximum-number-of-search-results/73683/3 "2017-11-08T19:43:46Z")

</div>

Hi @HAWK, thanks for the reply.

Is there anything that I can add in the search criteria or to a querystring to bypass the limit?

Kind regards

Rob

---

<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: [8 november 2017 om 22:59 UTC](https://meta.discourse.org/t/maximum-number-of-search-results/73683/4 "2017-11-08T22:59:30Z")

</div>

Not really, we do this here to protect the server, search becomes very expensive when you are paging through enormous amounts of topics, the offset keeps on costing more and more.

---

<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: [8 november 2017 om 23:31 UTC](https://meta.discourse.org/t/maximum-number-of-search-results/73683/5 "2017-11-08T23:31:16Z")

</div>

Why would you need more than 500 results? Who exactly is going to page 13 of search results?

---

<div class="post-metadata">

### Author: ![RobMeade](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/robmeade/32/109119_2.png) [@RobMeade](https://meta.discourse.org/u/RobMeade)
#### Post date: [9 november 2017 om 09:51 UTC](https://meta.discourse.org/t/maximum-number-of-search-results/73683/6 "2017-11-09T09:51:32Z")

</div>

It’s not a really a feature I am asking for - as such - I just wondered whether you had something like this in the background, almost like a debugging feature.

It isn’t something I would want to do every day, its just in this specific case I am trying to establish how many automated topics have been created, and, from those, how many have actually been replied to.

I have the number that are not replied to, 305, but what I don’t know is how many have been created altogether. If for example it was 400, then that would suggest the process of generating automated topics is a bit pointless, as they are not being used. If however it was 1,500, then that would be a little different.

Because the search stops at 500 results I am unable to determine this.

I am wondering whether perhaps I can use the date fields to get a series of mini-counts as it were, and then total them all up afterwards.

As I say, it was really just a one-time thing, not something I would need specific functionality for within the software itself, just wondered whether you had a little work-around for those times when perhaps you yourselves need it, but I guess you’d just query the database directly.

---

<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: [9 november 2017 om 15:07 UTC](https://meta.discourse.org/t/maximum-number-of-search-results/73683/7 "2017-11-09T15:07:07Z")

</div>

So all you need is the count not the actual results?

---

<div class="post-metadata">

### Author: ![RobMeade](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/robmeade/32/109119_2.png) [@RobMeade](https://meta.discourse.org/u/RobMeade)
#### Post date: [9 november 2017 om 15:12 UTC](https://meta.discourse.org/t/maximum-number-of-search-results/73683/8 "2017-11-09T15:12:23Z")

</div>

Yeah, pretty much, was just using the tools at my disposal.

If I could get a break down of the category / sub-category with their counts that would be useful, but not essential as if it comes to me having to delete them I will be going through category after category - just helps to have a bit of a work list.

The decision on removal is still to be made but I thought if I could present the figures then it would perhaps help.

Doesn’t matter if this isn’t possible, as I say I may be able to use the date range filters and and just repeat the searches changing the ranges each time until complete, just a bit of a pain 🙂

---

<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: [9 november 2017 om 18:30 UTC](https://meta.discourse.org/t/maximum-number-of-search-results/73683/9 "2017-11-09T18:30:43Z")

</div>

Could you use a [Data Explorer](https://meta.discourse.org/t/32566?silent=true) query to get the exact count?

---

<div class="post-metadata">

### Author: ![RobMeade](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/robmeade/32/109119_2.png) [@RobMeade](https://meta.discourse.org/u/RobMeade)
#### Post date: [9 november 2017 om 18:57 UTC](https://meta.discourse.org/t/maximum-number-of-search-results/73683/10 "2017-11-09T18:57:07Z")

</div>

I’ve nevered used them Joshua, where/how would I begin?

I have come from / been spoilt by direct access to SQL databases in the past, so pinging off the odd query here and there when needed was fairly straight forward - obviously now I’m on the other side of that fence 🙂

---

<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: [9 november 2017 om 19:00 UTC](https://meta.discourse.org/t/maximum-number-of-search-results/73683/11 "2017-11-09T19:00:15Z")

</div>

[Data Explorer](https://meta.discourse.org/t/32566?silent=true) very likely what you’re looking for then! It allows you to write SQL queries against the database. You can see the basics in the [Discourse Data Explorer](https://meta.discourse.org/t/data-explorer-plugin/32566) topic. In short, visit your plugins page and enable it. Then you’ll see [Data Explorer](https://meta.discourse.org/t/32566?silent=true) as a tab on the left site of the page. From there, just write the queries you need!

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

You may also wish to review [(Superseded) What cool data explorer queries have you come up with?](https://meta.discourse.org/t/what-cool-data-explorer-queries-have-you-come-up-with/43516) if you would like to see some sample queries.

---

<div class="post-metadata">

### Author: ![RobMeade](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/robmeade/32/109119_2.png) [@RobMeade](https://meta.discourse.org/u/RobMeade)
#### Post date: [9 november 2017 om 19:08 UTC](https://meta.discourse.org/t/maximum-number-of-search-results/73683/12 "2017-11-09T19:08:53Z")

</div>

oooh, now I think I may have stumbled across this, or something like this before, but then realised I wasn’t able to do it. Isn’t the ability to write these queries only for non-hosted customers? Ours is a hosted solution and I thought I saw/read before that this functionality wasn’t available to us. I would be happy to be wrong 🙂

/runs off…

/runs back…

Ooooh… looks like I can enable it!

Ok, thanks for this, I will have a dabble tomorrow and see what I can work out, and thanks for the link to the other post 🙂

---

<div class="post-metadata">

### Author: ![RobMeade](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/robmeade/32/109119_2.png) [@RobMeade](https://meta.discourse.org/u/RobMeade)
#### Post date: [10 november 2017 om 00:04 UTC](https://meta.discourse.org/t/maximum-number-of-search-results/73683/13 "2017-11-10T00:04:31Z")

</div>

This is _exactly_ what I needed - thank you so much for the heads up on this one.

I am of course desperately trying to remember all of the SQL syntax that used to roll off of the finger tips a couple years ago.

Please feel free to close this topic and thanks again 🙂

---

<div class="post-metadata">

### Author: ![HAWK](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hawk/32/86627_2.png) [@HAWK](https://meta.discourse.org/u/HAWK)
#### Post date: [10 november 2017 om 00:05 UTC](https://meta.discourse.org/t/maximum-number-of-search-results/73683/14 "2017-11-10T00:05:46Z")

</div>


