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

Class: Bs_Is_Searcher

Source Location: /plugins/indexserver/Bs_Is_Searcher.class.php

Class Overview

Bs_Object
   |
   --Bs_Is_Searcher

searcher class.


Author(s):

Version:

  • 4.0.$id$

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 28]
searcher class.

HOW THE WEIGHTENING WORKS:

count must-words/phrases 100%, may-words/phrases 70% and not-words/phrases use no weightening at all.

direct hits are counted 100% part hits are counted 60% stem hits are counted 50% metaphone hits are counted 35% soundex hits are counted 30%

dependencies: Bs_TextUtil, Bs_StopWatch




Tags:

copyright:  blueshoes.org
version:  4.0.$id$
author:  andrej arn <at blueshoes dot org>


[ Top ]


Class Variables

$Bs_Is_IndexServer =

[line 35]

reference to the "mother" IndexServer object.



Tags:

access:  public

Type:   object


[ Top ]

$Bs_TextUtil =

[line 42]

reference to global pseudostatic Bs_TextUtil.



Tags:

access:  public

Type:   object


[ Top ]

$hintString =  ''

[line 73]

after a search this string is filled with some text that may or may not be spitted out to the users face. :) gets reset on every new search start.



Tags:

see:  var $this->hintWords

Type:   string


[ Top ]

$hintWords =

[line 98]

after a search this array is filled with other words that have been found for a word that has not been found.

example: $hintWords = array( 'foo' => array( 'stem' => array('1454'=>'foob'), 'part' => array('645'=>'foobar', '123'=>'foofoo'), 'soundex' => array('999'=>'fuu', '888'=>'fooo'), ), ); so it's a hash where the key is the searched word, holding a hash with the keys 'stem', 'part' and 'soundex' each with numeric hashes of such words found (wordID is the key and the caption is the value).

currently there are hardcoded limits: 20 stem-words, 20 part-words and 10 soundex-words are made available here, even if there are more.




Tags:

see:  var $this->hintString

Type:   array


[ Top ]

$lang =

[line 63]

used for stemming, synonyme search, user interface etc.



Tags:

access:  public

Type:   string


[ Top ]

$parsedQuery =

[line 114]

after a search this is the result of Bs_TextUtil->parseSearchQuery().



Tags:

see:  var $this->queryData
access:  public

Type:   array


[ Top ]

$queryData =

[line 124]

after a search this information is set.

information (with word information and everything), has to do with the var $this->parsedQuery but offers much more. dump for details.




Tags:

see:  var $this->parsedQuery
access:  public

Type:   array


[ Top ]

$searchTime =

[line 106]

after a search this is the number of milliseconds used.



Tags:

since:  bs4.3

Type:   float


[ Top ]

$stopWatch =

[line 133]

instance od Bs_StopWatch.

gets created in the constructor for benchmarking, seeing where bottlenecks are, debugging etc.




Tags:

access:  public

Type:   object


[ Top ]



Class Methods


constructor Bs_Is_Searcher [line 143]

Bs_Is_Searcher Bs_Is_Searcher( object &$Bs_Is_IndexServer, object &$profile, mixed &$bsDb)

constructor please use the Bs_Is_IndexServer class to create a new Bs_Is_Searcher.



Tags:

access:  public


Parameters:

object   &$Bs_Is_IndexServer  
object   &$profile  

[ Top ]

method DEPRECATED_searchXXX [line 1447]

void DEPRECATED_searchXXX( [mixed $searchInput = ""], [mixed $preWhere = ""])



[ Top ]

method getQueryWordsForHighlight [line 1133]

array getQueryWordsForHighlight( )



Tags:

since:  bs4.5
status:  experimental
access:  public


[ Top ]

method listCollocations [line 2003]

string listCollocations( int $wordID)

debug function, lists the collocations for the given wordID.



Tags:

todo:  all (not coded yet)
since:  bs4.5 (todo)
access:  public


Parameters:

int   $wordID  

[ Top ]

method listRightNeighbors [line 1986]

string listRightNeighbors( int $wordID)

debug function, lists the right neighbors for the given wordID.



Tags:

since:  bs4.3
throws:  bs_exception
access:  public


Parameters:

int   $wordID  

[ Top ]

method recommendWords [line 1047]

array recommendWords( )

can be called after doing a search().



Tags:

return:  (hash where key is the word caption, value is a hash with the keys 'ID' and 'ranking'.)
since:  bs4.5
status:  experimental
access:  public


[ Top ]

method search [line 185]

array search( string $searchString, [mixed $lang = NULL], [mixed $features = NULL])

use search2(), it's the successor.

this is rather some proof-of-concept code, highly unoptimized. but works :)

synonyme searches would be cool.

todo: finish that feature: param $features: if you leave that with value null, the system will do its best do deliver good and useful results. example: if no or not many records are found, it will try a soundex search. on the other hand you can pass an array and tell what features to use. maybe you have an advanced-search where the user specifies that himself. the options are: part (part-of-word (eat*, cars*aring) stemming metaphone soundex synonyme caching hints




Tags:

return:  (vector filled with the record ID's ordered already. array may be empty.)
access:  public


Parameters:

string   $searchString  
mixed   $lang   (if you know the language of the input query, specify it. vector if it could be more than one.)
mixed   $features   (which features to use. see above.)

[ Top ]

method search2 [line 576]

? search2( string $searchString)



Tags:

since:  bs-4.5
access:  public


Parameters:

string   $searchString  

[ Top ]

method showWordInfo [line 1959]

string showWordInfo( string $searchString)

debug function to find out what we know about a word.



Tags:

return:  (dumped array)
since:  bs4.3
access:  public


Parameters:

string   $searchString  

[ Top ]

method _findWordIDs [line 1768]

void _findWordIDs( mixed &$queryData, mixed $lang, mixed $origFeatures)



[ Top ]


Documentation generated on Mon, 29 Dec 2003 21:11:33 +0100 by phpDocumentor 1.2.3