blueshoes php application framework and cms            applications_websearchengine
[ class tree: applications_websearchengine ] [ index: applications_websearchengine ] [ all elements ]

Class: Bs_Wse_Searcher

Source Location: /applications/websearchengine/Bs_Wse_Searcher.class.php

Class Overview

Bs_Object
   |
   --Bs_Wse_Searcher

dependencies: Bs_Url, Bs_StopWatch


Author(s):

Version:

  • 4.5.$Revision: 1.5 $ $Date: 2003/11/29 22:22:14 $

Copyright:

  • blueshoes.org

Variables

Methods


Inherited Variables

Inherited Methods

Class: Bs_Object

Bs_Object::Bs_Object()
Bs_Object::getErrors()
Basic error handling: Get *all* errors as string array from the global Bs_Error-error stack.
Bs_Object::getLastError()
Basic error handling: Get last error string from the global Bs_Error-error stack.
Bs_Object::getLastErrors()
Basic error handling: Get last errors string array from the global Bs_Error-error stack sinc last call of getLastErrors().
Bs_Object::persist()
Persists this object by serializing it and saving it to a file with unique name.
Bs_Object::setError()
Basic error handling: Push an error string on the global Bs_Error-error stack.
Bs_Object::toHtml()
Dumps the content of this object to a string using PHP's var_dump().
Bs_Object::toString()
Dumps the content of this object to a string using PHP's var_dump().
Bs_Object::unpersist()
Fetches an object that was persisted with persist()

Class Details

[line 35]
dependencies: Bs_Url, Bs_StopWatch



Tags:

pattern:  singleton: (pseudostatic)
since:  bs4.3
access:  public
version:  4.5.$Revision: 1.5 $ $Date: 2003/11/29 22:22:14 $
copyright:  blueshoes.org
author:  Andrej Arn <at blueshoes dot org>


[ Top ]


Class Variables

$Bs_Url =

[line 53]

reference to global pseudostatic instance.

gets set in the constructor.




Tags:

access:  public

Type:   object


[ Top ]

$Bs_Wse_WebSearchEngine =

[line 44]

reference to Bs_Wse_WebSearchEngine singleton.

gets set in the constructor.




Tags:

access:  public

Type:   object


[ Top ]

$numResults =

[line 107]

is set after a successful search.

tells the number of total results found, no matter of the $limit and $offset param.



Type:   int


[ Top ]

$searchStyleBody =  '<li>__LINK_TITLE__<br/>__DESCRIPTION__<br/>__LINK_URL__<hr size="1" noshade="true"/></li>'

[line 90]


Type:   mixed


[ Top ]

$searchStyleFoot =  '</ol>'

[line 91]


Type:   mixed


[ Top ]

$searchStyleHead =  '__HINTS_STRING__<br/><br/>__NUM_RESULTS_TOTAL__ Seiten gefunden.<br/><br/><ol start="__OFFSET++__">'

[line 89]


Type:   mixed


[ Top ]

$stopWatch =

[line 86]

instance od Bs_StopWatch.

gets created in init() for benchmarking, seeing where bottlenecks are, debugging etc.




Tags:

access:  public

Type:   object


[ Top ]

$urlMaxDisplayLength =  100

[line 98]

how many chars of the url are max. displayed.



Tags:

access:  public

Type:   int


[ Top ]



Class Methods


constructor Bs_Wse_Searcher [line 147]

Bs_Wse_Searcher Bs_Wse_Searcher( object &$Bs_Wse_WebSearchEngine, object &$profile, object &$bsDb)

constructor.



Parameters:

object   &$Bs_Wse_WebSearchEngine  
object   &$profile   (instance of Bs_Wse_Profile.)
object   &$bsDb   (instance of Bs_Db.)

[ Top ]

method getScrollbar [line 426]

string getScrollbar( )

returns the usual scrollbar line to jump to the next results.

did not come up with a better method name.




Tags:

return:  (html code)
access:  public


[ Top ]

method highlightStringComplicated [line 498]

string highlightStringComplicated( string $string, array $wordList, string $url)

highlight strings in string.



Tags:

access:  public


Parameters:

string   $string   (description or page content, where we have to find words.)
array   $wordList  
string   $url   (url for which we do this.)

[ Top ]

method search [line 222]

string search( mixed $searchString, [int $limit = 10], [int $offset = 0], [array $features = NULL], [array $categories = NULL], string $serchString)

use search2(), it's the successor.

performs a search for the given $searchString.

you can customize the output: in $this->searchStyleHead: __TIME_TAKEN__ __NUM_RESULTS_TOTAL__

in $this->searchStyleBody: __DESCRIPTION__ __TITLE__ __URL__ __LINK_TITLE__ __LINK_URL__




Tags:

return:  (html code)
access:  public


Parameters:

string   $serchString   (the user-submitted query)
int   $limit   (default is 10)
int   $offset   (default is 0)
array   $features   (see Bs_Is_Searcher->search().)
array   $categories   (hash with key=TRUE, NULL means all)

[ Top ]

method search2 [line 349]

string search2( mixed $searchString, [int $limit = 10], [int $offset = 0], [array $features = NULL], [array $categories = NULL], string $serchString)

same as search() but uses Bs_Is_Searcher->search2() instead of search().



Tags:

return:  (html code)
since:  bs-4.5
access:  public


Parameters:

string   $serchString   (the user-submitted query)
int   $limit   (default is 10)
int   $offset   (default is 0)
array   $features   (see Bs_Is_Searcher->search().)
array   $categories   (hash with key=TRUE, NULL means all)

[ Top ]

method setDbByDsn [line 184]

bool setDbByDsn( array $dsn)



Tags:

return:  TRUE
throws:  bs_exception
access:  public


Parameters:

array   $dsn  

[ Top ]

method setDbByObj [line 172]

void setDbByObj( object &$bsDb)

gives this class a db connection.



Tags:

access:  public


Parameters:

object   &$bsDb  

[ Top ]


Documentation generated on Mon, 29 Dec 2003 21:13:23 +0100 by phpDocumentor 1.2.3