IP.Board  3.3.0
search_engine Class Reference
Inheritance diagram for search_engine:
search_engine_blog search_engine_blog search_engine_calendar search_engine_ccs search_engine_core search_engine_downloads search_engine_downloads search_engine_forums search_engine_gallery search_engine_members search_engine_nexus

Public Member Functions

 __construct (ipsRegistry $registry)
 __construct (ipsRegistry $registry)
 formatSearchTerm ($search_term)
 formatSearchTerm ($search_term)
 isBoolean ()
 isBoolean ()
 logSphinxWarnings ()
 remapColumn ($column)
 remapColumn ($column)
 search ()
 search ()
 setCondition ($column, $operator, $value, $comp='AND')
 setCondition ($column, $operator, $value, $comp='AND')
 setDateRange ($begin, $end=0)
 setDateRange ($begin, $end=0)
 setMultiConditions ($conditions, $inner_comp='OR', $outer_comp='AND')
 setMultiConditions ($conditions, $inner_comp='OR', $outer_comp='AND')
 viewNewContent ()
 viewNewContent ()
 viewUserContent ($member)
 viewUserContent ($member)

Data Fields

 $sphinxClient

Protected Attributes

 $search_begin_timestamp = 0
 $search_end_timestamp = 0
 $whereConditions = array()

Constructor & Destructor Documentation


Member Function Documentation

formatSearchTerm ( search_term)

Formats search term for SQL

private

Parameters:
stringRaw IPB santized form input
Returns:
array array( 'search_term' => Safe string to use in SQL, 'removed' => array of removed search terms )
formatSearchTerm ( search_term)

Formats search term for SQL

private

Parameters:
stringRaw IPB santized form input
Returns:
array array( 'search_term' => Safe string to use in SQL, 'removed' => array of removed search terms )
isBoolean ( )

Can handle boolean searching

public

Returns:
boolean

Reimplemented in search_engine_ccs, search_engine_gallery, search_engine_downloads, search_engine_members, search_engine_calendar, and search_engine_core.

isBoolean ( )

Can handle boolean searching

public

Returns:
boolean

Reimplemented in search_engine_ccs, search_engine_gallery, search_engine_downloads, search_engine_members, search_engine_calendar, and search_engine_core.

Checks and logs any errors

public

Returns:
void
remapColumn ( column)

Remap standard columns (Apps can override )

public

Parameters:
string$columnsql table column for this condition
Returns:
string column
void

Reimplemented in search_engine_forums, search_engine_ccs, search_engine_gallery, search_engine_blog, search_engine_downloads, search_engine_downloads, search_engine_blog, search_engine_members, search_engine_calendar, search_engine_core, and search_engine_nexus.

remapColumn ( column)

Remap standard columns (Apps can override )

public

Parameters:
string$columnsql table column for this condition
Returns:
string column
void

Reimplemented in search_engine_forums, search_engine_ccs, search_engine_gallery, search_engine_blog, search_engine_downloads, search_engine_downloads, search_engine_blog, search_engine_members, search_engine_calendar, search_engine_core, and search_engine_nexus.

search ( )

Perform a search. Returns an array of a total count (total number of matches) and an array of IDs matching the required number based on pagination. The ids returned would be based on the filters and type of search

So if we had 1000 replies, and we are on page 2 of 25 per page, we'd return 25 items offset by 25

public

Returns:
array

Reimplemented in search_engine_forums, search_engine_ccs, search_engine_downloads, search_engine_gallery, search_engine_blog, search_engine_blog, search_engine_calendar, search_engine_core, search_engine_downloads, search_engine_members, and search_engine_nexus.

search ( )

Perform a search. Returns an array of a total count (total number of matches) and an array of IDs matching the required number based on pagination. The ids returned would be based on the filters and type of search

So if we had 1000 replies, and we are on page 2 of 25 per page, we'd return 25 items offset by 25

public

Returns:
array

Reimplemented in search_engine_forums, search_engine_ccs, search_engine_downloads, search_engine_gallery, search_engine_blog, search_engine_blog, search_engine_calendar, search_engine_core, search_engine_downloads, search_engine_members, and search_engine_nexus.

setCondition ( column,
operator,
value,
comp = 'AND' 
)

mySQL function for adding special search conditions

public

Parameters:
string$columnsql table column for this condition
string$operatorOperation to perform for this condition, ex: =, <>, IN, NOT IN
mixed$valueValue to check with
string$compComparison type
Returns:
void
setCondition ( column,
operator,
value,
comp = 'AND' 
)

mySQL function for adding special search conditions

public

Parameters:
string$columnsql table column for this condition
string$operatorOperation to perform for this condition, ex: =, <>, IN, NOT IN
mixed$valueValue to check with
string$compComparison type
Returns:
void
setDateRange ( begin,
end = 0 
)

Restrict the date range that the search is performed on

public

Parameters:
int$beginStart timestamp
int[$end] End timestamp
Returns:
void
setDateRange ( begin,
end = 0 
)

Restrict the date range that the search is performed on

public

Parameters:
int$beginStart timestamp
int[$end] End timestamp
Returns:
void
setMultiConditions ( conditions,
inner_comp = 'OR',
outer_comp = 'AND' 
)

Allows you to specify multiple conditions that are chained together

public

Parameters:
array$conditionsArray of conditions, each element has 3 keys: column, operator, value, see the setCondition function for information on each
string$inner_compComparison operator to use inside the chain
string$outer_compComparison operator to use outside the chain
Returns:
void
setMultiConditions ( conditions,
inner_comp = 'OR',
outer_comp = 'AND' 
)

Allows you to specify multiple conditions that are chained together

public

Parameters:
array$conditionsArray of conditions, each element has 3 keys: column, operator, value, see the setCondition function for information on each
string$inner_compComparison operator to use inside the chain
string$outer_compComparison operator to use outside the chain
Returns:
void

Perform the viewNewContent search Generic version Populates $this->_count and $this->_results

public

Returns:
nothin'

Reimplemented in search_engine_ccs, search_engine_forums, search_engine_downloads, search_engine_blog, search_engine_gallery, search_engine_blog, search_engine_downloads, search_engine_members, and search_engine_calendar.

Perform the viewNewContent search Generic version Populates $this->_count and $this->_results

public

Returns:
nothin'

Reimplemented in search_engine_ccs, search_engine_forums, search_engine_downloads, search_engine_blog, search_engine_gallery, search_engine_blog, search_engine_downloads, search_engine_members, and search_engine_calendar.

viewUserContent ( member)

Perform the search Populates $this->_count and $this->_results

public

Returns:
nothin'

Reimplemented in search_engine_ccs, search_engine_blog, search_engine_gallery, search_engine_blog, search_engine_downloads, search_engine_downloads, search_engine_forums, and search_engine_calendar.

viewUserContent ( member)

Perform the search Populates $this->_count and $this->_results

public

Returns:
nothin'

Reimplemented in search_engine_ccs, search_engine_blog, search_engine_gallery, search_engine_blog, search_engine_downloads, search_engine_downloads, search_engine_forums, and search_engine_calendar.


The documentation for this class was generated from the following files:
 All Data Structures Functions Variables