class vB_Search_Criteria

vB_Search_Criteria

Traits

Methods

__sleep()

No description

__wakeup()

No description

nothing
add_filter($field, $op, $value, $is_restrictive = false, $is_additive = false)

vB_Search_Criteria::add_filter() This function adds a generic filter to the criteria.

reset_filter($field)

No description

setUser($userid)

No description

getCurrentUser()

No description

set_include_sticky($set = true)

No description

get_include_sticky()

No description

set_sort($field, $direction, $is_additive = true)

Set the sort

add_contenttype_filter($contenttypeid, $op = vB_Search_Core::OP_EQ)

Filter by contenttype

add_keyword_filter(string $keywords, bool $titleonly)

Set the keywords

reset_keyword_filter()

No description

reset_post_processors()

No description

add_user_filter($username, $exactmatch)

Set the user filter

add_tag_filter($tags)

Add a filter for a tag

add_date_filter(???? $direction, ???? $dateline)

Add a filter for date

add_last_filter(???? $direction, ???? $dateline)

Add a filter for date

add_channel_filter($channelId, $depth = false, $include_starter = false, $depth_exact = false)

Add a channel filter

add_follow_filter($type, $userid)

Add a follow filter

add_exclude_filter($nodeids)

Add an exclude filter. Will exclude that node's children from the results

add_view_filter(string $view)

Adds special handleing for different views

add_null_filter(unknown_type $message)

forces a 0 result query and adds a message to the query

add_post_processors($processor)

No description

get_post_processors()

No description

get_filters($field) deprecated

No description

array
get_equals_filter($name, $force_array = false)

Get the equals filters defined

array
get_equals_filters($filterset = 'filters')

Get the equals filters defined

has_topic_view_filter()

No description

array
get_GT_filters($filterset = 'filters')

Get the equals filters defined

array
get_LT_filters($filterset = 'filters')

Get the equals filters defined

get_notequals_filters($filterset = 'filters')

Get the not equals filters defined

array
get_range_filters($filterset = 'filters')

Get the range filters defined

array.
get_keywords()

Return the parsed keywords to filter

string
get_raw_keywords()

Return the parsed keywords to filter

boolean
is_title_only()

Should the keywords be applied to the title or to both the title and the keywords

get_target_userid()

No description

has_errors()

No description

get_errors()

No description

add_error($error)

Add an error in processing.

get_sort()

No description

get_sort_direction()

No description

get_sort_field()

No description

getIncludeStarter()

No description

getDepth()

No description

getDepthExact()

No description

sanitize_search_query($query, $errors)

No description

get_contenttype()

No description

get_contenttypeid()

No description

boolean
get_criteria_set()

vB_Search_Criteria::get_criteria_set() This function determines whether we have gotten some criteria that would limit the search results significantly. We don't want to do a search that would return the entire table.

setJSON(array $JSON)

sets the JSON criteria

array
getJSON()

gets the JSON criteria

setIgnoreCache(boolean $flag)

(re)sets the caching flag

boolean
getIgnoreCache()

gets the caching flag

setNoLimit(boolean $set = 1)

(re)sets the nolimit flag

boolean
getNoLimit()

gets the nolimit flag

get_ignored_keywords()

No description

Details

in vB_Trait_NoSerialize at line 15
__sleep()

in vB_Trait_NoSerialize at line 20
__wakeup()

at line 60
nothing add_filter($field, $op, $value, $is_restrictive = false, $is_additive = false)

vB_Search_Criteria::add_filter() This function adds a generic filter to the criteria.

Should generally be used either internally in the criteria object, or in the add_advanced_fields function on the search type objects. Search consumers should generally be calling higher level functions.

Parameters

$field
$op
$value
$is_restrictive
$is_additive

Return Value

nothing

at line 96
reset_filter($field)

Parameters

$field

at line 101
setUser($userid)

Parameters

$userid

at line 106
getCurrentUser()

at line 111
set_include_sticky($set = true)

Parameters

$set

at line 116
get_include_sticky()

at line 129
set_sort($field, $direction, $is_additive = true)

Set the sort

Only allow single field sorts

Parameters

$field
$direction
$is_additive

at line 160
add_contenttype_filter($contenttypeid, $op = vB_Search_Core::OP_EQ)

Filter by contenttype

Parameters

$contenttypeid
$op

at line 193
add_keyword_filter(string $keywords, bool $titleonly)

Set the keywords

Parameters

string $keywords
bool $titleonly true if onl

at line 238
reset_keyword_filter()

at line 243
reset_post_processors()

at line 256
add_user_filter($username, $exactmatch)

Set the user filter

Parameters

$username
$exactmatch

at line 304
add_tag_filter($tags)

Add a filter for a tag

Parameters

$tags

at line 357
add_date_filter(???? $direction, ???? $dateline)

Add a filter for date

Parameters

???? $direction direction
???? $dateline the dateline to limit the query to.

at line 368
add_last_filter(???? $direction, ???? $dateline)

Add a filter for date

Parameters

???? $direction direction
???? $dateline the dateline to limit the query to.

at line 378
add_channel_filter($channelId, $depth = false, $include_starter = false, $depth_exact = false)

Add a channel filter

Parameters

$channelId
$depth
$include_starter
$depth_exact

at line 407
add_follow_filter($type, $userid)

Add a follow filter

Parameters

$type
$userid

at line 416
add_exclude_filter($nodeids)

Add an exclude filter. Will exclude that node's children from the results

Parameters

$nodeids

at line 428
add_view_filter(string $view)

Adds special handleing for different views

Parameters

string $view

at line 471
add_null_filter(unknown_type $message)

forces a 0 result query and adds a message to the query

Parameters

unknown_type $message

at line 476
add_post_processors($processor)

Parameters

$processor

at line 481
get_post_processors()

at line 492
get_filters($field) deprecated

deprecated We need a cleaner way to get at the filters on the search implementation side.

Parameters

$field

at line 509
array get_equals_filter($name, $force_array = false)

Get the equals filters defined

Parameters

$name
$force_array

Return Value

array Array of $filtername => $value for equals filters $value can either be a scalar or an array

at line 528
array get_equals_filters($filterset = 'filters')

Get the equals filters defined

Parameters

$filterset

Return Value

array Array of $filtername => $value for equals filters $value can either be a scalar or an array

at line 541
has_topic_view_filter()

at line 557
array get_GT_filters($filterset = 'filters')

Get the equals filters defined

Parameters

$filterset

Return Value

array Array of $filtername => $value for equals filters $value can either be a scalar or an array

at line 577
array get_LT_filters($filterset = 'filters')

Get the equals filters defined

Parameters

$filterset

Return Value

array Array of $filtername => $value for equals filters $value can either be a scalar or an array

at line 597
get_notequals_filters($filterset = 'filters')

Get the not equals filters defined

@return array Array of $filtername => $value for not equals filters $value can either be a scalar or an array

Parameters

$filterset

at line 618
array get_range_filters($filterset = 'filters')

Get the range filters defined

Parameters

$filterset

Return Value

array Array of $filtername => $value for not equals filters $value is array($min, $max). A null value for $min or $max means no limit in that direction.

at line 658
array. get_keywords()

Return the parsed keywords to filter

Return Value

array. An array of array("word" => $word, "joiner" => $joiner) where $word is the keyword and $joiner indicates how the word should be joined to the query. $joiner should be one of "AND", "OR", or "NOT" with the exception of the first item for which $joiner is NULL. It is up to the search implementation to define exactly how to treat the words specified.

at line 673
string get_raw_keywords()

Return the parsed keywords to filter

Return the raw query set to the criteria object. Provided in case an implementation cannot or does not want to use the words array above. If the raw query is used then the display string and highlights should be set by the implementation to better reflect how the query is processed.

Return Value

string

at line 684
boolean is_title_only()

Should the keywords be applied to the title or to both the title and the keywords

Return Value

boolean

at line 689
get_target_userid()

at line 711
has_errors()

at line 716
get_errors()

at line 737
add_error($error)

Add an error in processing.

Intended to be used publically and by the advanced search fields

Parameters

$error

at line 742
get_sort()

at line 747
get_sort_direction()

at line 753
get_sort_field()

at line 760
getIncludeStarter()

at line 765
getDepth()

at line 770
getDepthExact()

at line 868
sanitize_search_query($query, $errors)

Parameters

$query
$errors

at line 936
get_contenttype()

at line 957
get_contenttypeid()

at line 986
boolean get_criteria_set()

vB_Search_Criteria::get_criteria_set() This function determines whether we have gotten some criteria that would limit the search results significantly. We don't want to do a search that would return the entire table.

Return Value

boolean

at line 995
setJSON(array $JSON)

sets the JSON criteria

Parameters

array $JSON

at line 1004
array getJSON()

gets the JSON criteria

Return Value

array $JSON

at line 1013
setIgnoreCache(boolean $flag)

(re)sets the caching flag

Parameters

boolean $flag

at line 1022
boolean getIgnoreCache()

gets the caching flag

Return Value

boolean

at line 1036
setNoLimit(boolean $set = 1)

(re)sets the nolimit flag

Parameters

boolean $set

at line 1045
boolean getNoLimit()

gets the nolimit flag

Return Value

boolean

at line 1050
get_ignored_keywords()