Search for posts gives wrong/incomplete results

AI-generated summary

A user, Tiaryn, is experiencing issues with the search function in Discourse, specifically when searching for posts with the title “Protokoll der FSR-Sitzung vom dd.mm.yyyy” (protocol of the FSR meeting on dd.mm.yyyy). The search results include posts that contain the search terms but do not exactly match the post content. cpradio suggests that the issue might be due to similar posts being rolled up into a single result because they are in the same topic. Tiaryn confirms that the posts are in the same topic and expresses concerns about not being able to fetch the desired post via API requests.

sam recommends using the “search within topic” API, which Tiaryn finds to be a working solution. Tiaryn also asks if this solution is documented anywhere, as they had to inspect their browser’s requests to build the correct URL.

Hi!

We have a topic in Discourse where meeting protocols are posted and discussed. Every protocol post begins with “Protokoll der FSR-Sitzung vom dd.mm.yyyy,” where dd.mm.yyyy is, of course, the date of the meeting.

Searching for these posts does not always yield the expected results.
Example:
There is a post with this text:

Protokoll der FSR-Sitzung vom 25.07.2018
[…]

Search query:
/search/query.json?term=protokoll+der+fsr-sitzung+vom+25.07.2018
Result:

Protokoll der FSR-Sitzung vom 18.07.2018
[…]
Next meeting: 25.07.2018

The result is not incorrect because it contains everything I searched for, but it is missing the post where the search string exactly matches the post content.
Shouldn’t I receive this post as well, since it exactly matches the search string?

Unfortunately, the forum is private, so I cannot share the posts and search queries directly, but I hope you can shed some light on this :slight_smile:

Greetings

Are both posts in the same topic? I think there is logic that rolls up similar posts found into a single result in the search because it is in the same topic (but I very well could be wrong)

Yes, the posts are in the same topic. You could be right but there would be no way to fetch the post I need via API requests in that case. That doesn’t seem right.

If you know you are searching within a topic why not use the “search within topic” API?

test 25.07.2018

AND

Hi! Thank you for your answer. It’s working that way!
Is this documented anywhere? I checked what my browser was requesting to build my URL.