# Am I using the Discourse gem correctly?

**URL:** https://meta.discourse.org/t/am-i-using-the-discourse-gem-correctly/145503
**Category:** Support
**Created:** [March 25, 2020, 7:51am UTC](https://meta.discourse.org/t/am-i-using-the-discourse-gem-correctly/145503 "2020-03-25T07:51:30Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![AstonJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/astonj/32/215041_2.png) [@AstonJ](https://meta.discourse.org/u/AstonJ)
#### Post date: [March 25, 2020, 7:51am UTC](https://meta.discourse.org/t/am-i-using-the-discourse-gem-correctly/145503/1 "2020-03-25T07:51:30Z")

</div>

I’m trying to retrieve topics with a certain tag, posted after a certain date and ordered by likes. When I do the search on the forum I get 6 topics, but via the gem I only get 5.

Here’s the query `in:first after:2020-03-20 tags:covid19 order:likes`

Here’s the resulting search url:

```plaintext
search?expanded=true&q=in%3Afirst%20after%3A2020-03-20%20tags%3Acovid19%20order%3Alikes%20order%3Alikes

```

With json:

```plaintext
search.json?expanded=true&q=in%3Afirst%20after%3A2020-03-20%20tags%3Acovid19%20order%3Alikes%20order%3Alikes

```

(the forum and via .json show the same amount of topics)

Here’s the gem query:

```plaintext
s=client.search("tags:covid19 in:first after:2020-03-20 order:likes")

```

Then `s["topics"].size` shows 5

Am I doing something wrong? 😕

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [March 29, 2024, 3:21pm UTC](https://meta.discourse.org/t/am-i-using-the-discourse-gem-correctly/145503/2 "2024-03-29T15:21:59Z")

</div>


