How to get a search result with sitelinks in google?

Yes, the “additional” results are “sitelinks” and Discourse does what needs to be done on its end. Whether or not they get included in any particular search results page is up to Google. You don’t get them, Google gives them.