Class: search

Source Location: /bblog/libs/search.class.php ( Revision Log )

Class search

Direct descendents
Child Class Description
article_search Requirements

[ Top ]
Property Summary
boolean   $trans   settings for MySQL transaction support

[ Top ]
Method Summary
boolean   add_results()   Create searchable items database
boolean   del_results()   Delete search database or ".T_SEARCH." items
boolean   index_all()   Create search index for all items
boolean   make_tmp()   search for string and save string to temporary results
string   replace()   Standartize text, for example "S*O*M*E" to "some"
array   search_query()   search for query, for example "word word word"
boolean   _add()   Add word to search database
boolean   _check_tmp()   Check for temporary search results
boolean   _clear_tmp()   Clear temporary results
boolean   _search_tmp()   search for one word

[ Top ]
Properties
boolean   $trans = true [line 56]

settings for MySQL transaction support

for MySQL4 and above recommended true for MySQL3 recommended false


[ Top ]
Methods
add_results  [line 72]

  boolean add_results( string $col, string $score, integer $id  )

Create searchable items database

Parameters:
string   $col:  - column of $this->table
string   $score:  - priority of column (higher for titles, lower for content)
integer   $id:  - id of item

API Tags:
Return:  - always true


[ Top ]
del_results  [line 109]

  boolean del_results( [$id $id = 0]  )

Delete search database or ".T_SEARCH." items

Parameters:
$id   $id:  - items to delete (0 = all items)

API Tags:
Return:  - result of deleting database


[ Top ]
index_all  [line 191]

  boolean index_all( )

Create search index for all items



[ Top ]
make_tmp  [line 163]

  boolean make_tmp( string $string  )

search for string and save string to temporary results

Parameters:
string   $string: 


[ Top ]
replace  [line 62]

  string replace( string $text  )

Standartize text, for example "S*O*M*E" to "some"

Parameters:
string   $text:  - text for standartize


[ Top ]
search_query  [line 175]

  array search_query( string $query  )

search for query, for example "word word word"

Parameters:
string   $query: 

API Tags:
Return:  results


[ Top ]
_add  [line 125]

  boolean _add( string $goods_id, string $value, integer $score  )

Add word to search database

Parameters:
string   $goods_id: 
string   $value: 
integer   $score: 


[ Top ]
_check_tmp  [line 152]

  boolean _check_tmp( string $string  )

Check for temporary search results

Parameters:
string   $string: 


[ Top ]
_clear_tmp  [line 143]

  boolean _clear_tmp( [integer $time = 1800]  )

Clear temporary results

Parameters:
integer   $time:  - Time in seconds for hold cache


[ Top ]
_search_tmp  [line 134]

  boolean _search_tmp( string $string  )

search for one word

Parameters:
string   $string: 


[ Top ]