הצג את image_url בתוצאות החיפוש של ה-json

סיכום מבוסס בינה מלאכותית

The discussion revolves around the absence of image_url in the JSON search results returned by Discourse’s API. Bcat notes that while image_url is available in other endpoints like category, tag, and top searches, it is missing in search queries, leading to inefficient workflows requiring multiple API calls to retrieve images. neounix confirms this issue, citing a specific search query where the image_url field is absent despite the presence of an image in the topic. bombledmonk also reports the same problem, referencing API documentation and providing visual evidence. Bcat suggests a workaround using external solutions if needed, highlighting the inconsistency in the API’s behavior.

I want to display image_url in the json results I return when searching for the topic.

Is it available in the query form, I see it now returns False in the source code

/search.json?q=loreal&image_url=true

You can check demo online here: https://thuvienmuasam.com/t/may-han-mini-an-toan-gia-tot-mua-o-dau/1786 (Sorry for the language, it’s at the end of the post)

Is it blocked here

Hey @Bcat

Did you see this?

With queries json category, tag, top, newest all include image_url
But with search, no include image_url

Currently I am querying 1 json for a list (10 topic)
Then there are 10 queries to get the image.
In total, it took 11 queries to the server.

I’m not 100% sure this is the same problem, but I think it could be. I’m using the search api, the image_url no longer seems to show up in the topics array using this query. The object in the topics array links here where there is an image in the top post, but unless I’m misunderstanding something in the API docs (which I might be) the image_url is missing. It’s been a while since I’ve looked at this, but I thought this used to work as-is.

Yes it is no longer there.

If you need an external solution interfering with the discourse, I can suggest you.