# Search

Search

This section provides necessary functions related to search, current it supports basic topic and post search.

# search_topic

Function:

Function Name Description Level
search_topic a simple search allows user to enter a query string and it will return a list of topics 3

Input Parameters:

Name Type Required? Description Level
search_string byte[] query string. At least 3 characters to start the search. If search_id is provide, this parameter will be ignored. 3
start_num Int yes For pagination. If start_num = 0 & last_num = 9, it returns first 10 posts from the topic, sorted by date. If both are not presented, return first 20 posts 3
last_num Int 3
search_id String for caching and for pagination support. If the previous response contains "search_id" key, you can pass it for subsequent pagination call 4

Output Parameters:

Name Type Required? Description Level
total_topic_num Int yes returns total number of subscribed forums 3
search_id String return the search id so the app can send the same id back to the server for pagination support 3
topics Array of Hash table yes returns an array of topics 3
forum_id String yes 3
forum_name byte[] yes 3
topic_id String yes 3
topic_title byte[] yes Remove all BBCode in title 3
post_author_id String yes 4
post_author_name byte[] 3
post_time Date dateTime.iso8601 format. If this topic has no reply, use the topic creation time. 3
timestamp String Timestamp of topic last reply
icon_url String Return topic author avatar URL 3
short_content byte[] yes Characters display rules (should follow this sequence): 1) Remove all BBCode except [ur], [img]. 2) Convert "[url http://...]http://…..[/url]" to "[url]". 3) Convert "[img]http://…..[/img]" to "[img]". 4) Remove "Last edited by..." tag at the end. 5) Remove all non-displayable characters (e.g. \n, \t, etc). 6) Remove all whitespace, /n and /r at the begining and ending of the content. 7) return only first 200 characters 3
reply_number Int yes total number of reply in this topic. If this is no reply in this return, return 0. 3
view_number Int yes total number of view in this topic 3
new_post Boolean yes return true if this topic contains new post since user last login 3
is_closed Boolean return true if this thread has been closed. 3
is_subscribed Boolean return true if this thread has been subscribed by this user. 3
can_subscribe Boolean returns false if the subscription feature is turned off 3
post_id String When search by keywords, this field need to be returned as the id of post which contains the search keywords.

# search_post

Function:

Function Name Description Level
search_post a simple search allows user to enter a query string and it will return a list of post that matched the query. 3

Input Parameters:

Name Type Required? Description Level
search_string byte[] query string. At least 3 characters to start the search. If search_id is provide, this parameter will be ignored. 3
start_num Int yes For pagination. If start_num = 0 & last_num = 9, returns first 10 posts, sorted by date. If both are not presented, return first 20 posts 3
last_num Int 3
search_id String for caching and for pagination support 4

Output Parameters:

Name Type Required? Description Level
total_post_num Int yes returns total number of posts found 3
search_id String return the search id so the app can send the same id back to the server for pagination support 3
posts Array of Hash table yes returns an array of topics 3
forum_id String yes 3
forum_name byte[] yes 3
topic_id String yes 3
topic_title byte[] yes Remove all BBCode in title 3
post_id String yes 3
post_title byte[] yes 3
post_author_id String 4
post_author_name byte[] yes 3
post_time Date yes dateTime.iso8601 format. If this topic has no reply, use the topic creation time. 3
timestamp String yes Timestamp of topic last reply
icon_url String yes Return topic author avatar URL 3
short_content byte[] Characters display rules (should follow this sequence): 1) Remove all BBCode except [ur], [img]. 2) Convert "[url http://...]http://…..[/url]" to "[url]". 3) Convert "[img]http://…..[/img]" to "[img]". 4) Remove "Last edited by..." tag at the end. 5) Remove all non-displayable characters (e.g. \n, \t, etc). 6) Remove all whitespace, /n and /r at the begining and ending of the content. 7) return only first 200 characters 3

# search

Function:

Function Name Description Level
search advanced search in tapatalk 4

Input Parameters:

Name Type Required? Description Level
[search filter] Array of Hash table yes This function accept a few search filters as below. Only one hash parameter was needed and the filter key must be specified. Filter keys order do not required. 4
searchid String For pagenation feature. If this key was specified, all below keys will be ignored, except 'page' and 'perpage' 4
page Int The page number of search result you need. Default will return page 1 4
perpage Int Topic/Posts perpage. Default is 20. 4
keywords byte[] The key words we want to search. 4
userid String Search content posted by user with user id
searchuser byte[] search content posted by user with user name 4
forumid String search only in forum with forumid 4
threadid String search only in thread with threadid 4
titleonly Int seach title only? Accept 0 and 1 4
showposts Int Show results as posts? Accept 0 and 1 4
searchtime Int Search topic/post replied or posted in [searchtime] seconds. 4
started_by Boolean Used when search user's topic, indicate if only user started topics should be returned. When this parameter was specified, 'showposts' status will always be false. This is a new feature of search function, and flag 'search_started_by' in get_config will indicate the support of this feature.
only_in Array of String Array of forum id, the search result must be in these forums 4
not_in Array of String Array of forum id, the search result must not be in these forums 4

Output Parameters:

Name Type Required? Description Level
[search result] String The search result is the same as search_topic and search_post differ by key 'showposts' 4