William
15 years agoHelper
API search type
hi I noticed that in lithium forum, we can get the different result in 2 ways, Topics and Specific posts when searching. now i can get the correct result by Specific posts using following API...
A "Topic" is actually a message too. It is simply a "root message" in a thread.
The API supports getting the following from Search:
* Subject / title of post - <subject>
* Time-stamp - <post_time>
* URL to post (for hyperlink) – view_href attribute on <message>
* Author – <author>
* URL to author profile – view_href attribute on <author>
* Message Body – <body> (requires passing an additional parameter to the request - restapi.format_detail=full_list_element)
Since "Subject / title of post" is what you want (I think), can you parse it so that is what is the user ends up seeing?
I have the same question and feel it is still not answered here.
My business requirement is: show top 5 threads that are relevant to a given search string.
That is, either "root message" or whatever other message in the thread contains the search string.
The top 5 threads shown should be unique (no duplication).
Also, for each thread shown I need to show some metadata (number of messages in the thread, last post date and user, etc).
So far the closest API method I've found is like:
/search/messages?q=my+search+string&collapse_discussion=true
but it returns messages separately (even if they are in the same thread) and the collapse_discussion parameters seems not working (no change in the result).
Hi altumano,
I think that you should use the following query parameter: "is_root:true"
More info about it, can be found here:
http://lithosphere.lithium.com/t5/Developers/Ssearch-for-count-threads/m-p/57028/highlight/true#M1885