The search JSON parameter has the following format:
{ "filter": <value>, "filter": <value>, ... }
Filters
The valid filters / parameters are:
keywords
- string – list of words that you want to search for. Accepts “AND” (default), “OR” and “NOT” operators. Short, common and bad words are omitted from the search criteria.
{ "keywords":"string bass NOT fishing" }
- boolean - search will be reduced to the title only.
{ "title_only":"1" }
- number – the channel id that the results should belong to.
{ "channel":"3" }
depth
- number - used in conjunction with the channel filter.
{ "depth":"1" }
- boolean
{ "include_starter":"1" }
- boolean – filters the results to return only the featured ones.
{ "featured":"1" }
- number – the id of the contentype – will return only this type of results.
- array – list of contentype ids – will return only the specified type results. Ex:
{ "contenttypeid":"22" } { "contenttypeid":[9,22] }
type
- string – the name of the contentype - will return only this type of results.
- array – list of contentypes – will return only the specified type results. Ex:
{ "type":"vBForum_Gallery" } { "type":["vBForum_Gallery","vBForum_Poll"] }
- If private messages are requested, an "include_private_messages" filter is enforced.
- If private message is the only type requested a "private_messages_only" filter is enforced instead.
- If visitor message is the only type requested a "visitor_messages_only" filter is enforced.
- If photo is the only type requested an "include_attach" filter is enforced.
exclude_type
- number – the id of the contentype – will exclude this type from the results.
- string – the name of the contentype - will exclude this type from the results.
- array – list of contentype ids of classes – will exclude the specified type from results.
{ "exclude_type":"22" } { "exclude_type":"vBForum_Gallery" } { "exclude_type":[9,22] } { "exclude_type":["vBForum_Gallery","vBForum_Poll"] } { "exclude_type":[9,"vBForum_Poll"] }
author
- string – the name of the user (default behavior is partial search – see exactname filter)
- array – the list of user names.
- "myFriends" – will match all the current users' friends
- "iFollow" – will match all the posts by the users the current users follows.
{ "author":"John Doe" } { "author":["John", "Luke", "Mark"] } { "author":"myFriends" } { "author":"iFollow" }
exactname
- boolean – used in conjunction with the author filter(when a string is given) and specifies whether the author name is an exact string.
{ "author":"John","exactname":"1" }
This filter is used in conjunction with the visitor message content type filter and specifies the user the message was sent to.
- number – the id of the user
- array – the list of user ids. Ex:
{ "sentto":10 } { "sentto":[10,12,13] }
visitor_messages_only
- boolean – used in conjunction with the authorid filter and will include only the visitor messages that the author sent OR received
{ "authorid":"10","visitor_messages_only":"1" }
tag
- string – list of tags to filter by.
- array – list of tags to filter by.
{ "tag":"tag1 tag2 tag3" } { "tag":["tag1","tag2","tag3"] }
- string – the prefixid
{ "prefix":"interesting" }
- boolean
{ "has_prefix":"1" }
- boolean – Ex:
- array – list of prefixes to filter by Ex:
{ "no_prefix":"1" } { "prefix":["interesting","awesome","great"] }
- "lastVisit" – will show results from the current user's last visit
- "topicAge" – will show results starting from <"max_age_topic" setting> days
- "channelAge" – will show results starting from <"max_age_channel" setting> days
- JSON - A JSON-encoded string with the following parameters:
- "from" with a low integer will filter the results that are newer than the number of days specified
- "to" will filter the results that are older than the number of days specified
- special values for "from" and "to":
- lastDay - will translate to 1 day (+ or - depending of what you assigned, to "from" or "to")
- lastWeek - will translate to 1 week
- lastMonth - will translate to 1 month
- lastYear - will translate to 1 year
{ "date":{"from":"10"} }
Example of JSON with "from":
{ "date":{"from":"1315515930"} }
Example of JSON with "to":
{ "date":{"to":"10"} }
Example of JSON with "to":
{ "date":{"to":"1315515930"} }
exclude
- array – list of node ids that need to be excluded from the results.
- number – the id of the node that needs to be excluded from the results.
{ "exclude":[1,2,3,4] } { "exclude":"24" }
- array – list of node ids that the search is limited to.
- number – the id of the node that the search is limited to.
{ "specific":[1,2,3,4] } { "specific":"24" }
- boolean
{ "starter_only":"1" }
- boolean
{ "reply_only":"1" }
- boolean
{ "comment_only":"1" }
- string - the follow type, valid values are:
- followContent - will match the content the current user is specifically following
- followChannel - will match content from channels the current user is following
- followMembers - will match content created by users the user current is following
- followBoth - same as followContent and followChannel
- followAll - matches anything the the current user is following, including posts from followed users
- string - the follow type, valid values are:
{ "follow":"followContent" }
- array - has be in a form of:
{ "follow":{<follow_type>:<userid>} }
- <follow_type> is on of the types specified above
- <userid> is the id of the user the following is based of
- boolean
{ "my_following":"1" }
- boolean
{ "include_blocked":"1" }
Also includes posts by users in the ignorelist of the current user
ignore_protected
- boolean
{ "ignore_protected":"1" }
- boolean
{ "deleted_only":"1" }
exclude_deleted
- boolean
{ "exclude_delete":"1" }
- boolean
{ "unapproved_only":"1" }
unread_only
- boolean
{ "unread_only":"1" }
include_attach
- boolean
{ "include_attach":"1" }
sticky_only
- boolean
{ "sticky_only":"1" }
- boolean
{ "exclude_sticky":"1" }
include_sticky
- boolean
{ "include_sticky":"1" }
view
- string - One of the values specified below
{ "view":"activity" }
- activity
- topic
- conversation_thread
- conversation_stream
ignore_cache
- boolean
{ "ignore_cache":"1" }
sort
- string – any of the following:
{ "sort":"relevance" }
{ "sort":"title" }
JSON
{ "<field>":"<direction>" }
{ "sort":{"title":"desc"} }
{ "sort":{"publishdate":"asc"} }
{ "custom":{"somecustomfield":{"anything":"value can be anything, including array and JSON"}} }
The value can be anything that can be encoded in a JSON.
nolimit
{ "nolimit":1 }
Do not use it on the activity views or search pages/widgets.
my_channels
- string – one of following:
{ "my_channels":{"type":"group"} }
Examples:
{ "author":"myFriends", "date":{"from":"7"}, "type":"vBForum_Photo" }
{ "featured":"1", "date":{"from":"2010/10/01","to":"31"}, "keywords":"fishing OR camping" }
{ "author":"admin", "exactname":"1", "tag":["important","crucial","paramount"] }
{ "author":["fred","john"], "date":"last_visit", "channel":4 }
{ "author":"olly", "contenttypeid":[22,24], "sort":{"author":"asc"} }
{ "keywords":"cooking", "title_only":"1", "author":[7,12], "date":{"from":"1315515930"} "sort":"relevance" }