Is this possible with the API? The purpose is to get a list of topics in a category that contain a PDF, or other media file attached.
AI-generated summary
The discussion revolves around filtering topics in a category that contain file attachments using the Discourse API. owengot inquires about the possibility of achieving this, and renato suggests using advanced search with a JSON serializer to retrieve the desired results. Another option proposed by simon is to write a Data Explorer query and run it via the API.
owengot finds the search parameter method to be the easiest option but seeks clarification on using and/or operators for search queries, specifically combining search terms or filetypes. They provide an example of a search query that does not yield the expected results, and ask if it is possible to achieve this without performing individual queries for each term.
You can use the advanced search:
https://meta.discourse.org/search?q=filetype%3Apdf%20%23support
(searches for filetype:pdf #support)
Routes on Discourse have a JSON serializer, so you can tweak the search and then use /search.json?q=your-query.
Another option would be to write a Data Explorer query that returns the topics you are looking for. You could then run that query via the API: How to run Data Explorer queries with the Discourse API.
It looks like search with the parameter would be the easiest option.
Are there and / or operators for search queries? I found the option for categories, but I would like to combine search terms or filetypes - for example
https://meta.discourse.org/search?q=YouTube,soundcloud%20%23support%20
I get 5 results for the combined terms - but it is not showing results for individual terms. Searching just for “soundcloud” on the other hand yields 15 results. I would like to get both with one query.. Would this be possible without doing an individual query for each?