Forum Discussion

William's avatar
William
Helper
15 years ago

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

 

/restapi/vc/search/messages?q=wrt

 

 

but how can i get the result by topics?

 

is there something i can refer to?

 

thanks:smileymad:

 

 

3 Replies

  • JakeR's avatar
    JakeR
    Khoros Oracle
    15 years ago

    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?

  • altumano's avatar
    altumano
    Contributor
    14 years ago

    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).