[ Index ]
 

Code source de SPIP Agora 1.4

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/Agora1-4/ecrire/include/sevenseas/ -> SearchEngine.php (sommaire)

(pas de description)

Poids: 304 lignes (8 kb)
Inclus ou requis: 1 fois
Référencé: 0 fois
Nécessite: 1 fichier
 Agora1-4/ecrire/include/sevenseas/ResultBuilder.php

Définit 1 class

SearchEngine:: (12 méthodes):
  SearchEngine()
  factory()
  setResultBuilder()
  getResultBuilder()
  setLogger()
  enableLogging()
  disableLogging()
  search()
  _parseResultXMLStream()
  _computeQuery()
  _searchLog()
  _cleanInputStream()


Classe: SearchEngine  - X-Ref

This class is designed as a Search Engine abstraction.
Its goal is to offer a standard API for various indexers
such as mnoGoSearch, ht://dig, MS IndexServer, etc...
It uses XML streams to serve search results. Please refer
to the package documentation for more detailed information !
Each specific implementation must use some configuration technique
so that the behaviour of an indexer can be finely tuned !

SearchEngine()   X-Ref
Base constructor.


factory($engineType)   X-Ref
Attempts to return a valid implementation of the SearchEngine base class
based on the $engineType parameter.

param: String  $engineType : actually supported engine types are
return: mixed   Either an instance of the desired specific SearchEngine

setResultBuilder($resultBuilder)   X-Ref
This method sets the ResultBuilder used by this instance.
It return a PEAR::Error if the the ResultBuilder is not valid.

param: ResultBuilder   used to build search results
return: mixed           void if ResultBuilder is valid, PEAR::Error otherwise.

getResultBuilder()   X-Ref
This method returns a reference to the ResultBuilder used by this instance.

return: ResultBuilder

setLogger(&$logger)   X-Ref
This method sets the optionnal logger for this instance.
This method MUST be called prior to enableLogging.

param: Log     Logger

enableLogging()   X-Ref
This method enables logging. It returns a PEAR::Error if the instance
internal logger has not been set

return: mixed   void if logging is possible, PEAR::Error otherwise.

disableLogging()   X-Ref
This method disables logging.


search($queryParams)   X-Ref
Computes the given query, and return the SearchResult array

param: Array     $queryParams containing the various params
return: mixed    Instance of SearchResults or PEAR_Error

_parseResultXMLStream($inputStream)   X-Ref
This method parses an XML stream representing the search results
and generates the Array of SearchResult instances, keeping the
results in the same order as in the stream.

param: String  $inputStream representing the XML Stream to parse.
return: mixed   Instance of SearchResults or PEAR_Error

_computeQuery($queryParameters)   X-Ref
This is an abstract method that computes the query and return the XML
stream. This method must me implemented for each specific index engine

param: Array       query parameters
return: String      XML result stream

_searchLog($message, $priority = LOG_INFO)   X-Ref
This methods is used to send information to the logger
or exits immediately if there is no logger attached
to this SearchEngine instance

param: String    $message represents the message to log
param: int       $priority represents the message priority. Refer to

_cleanInputStream($inputStream)   X-Ref
This method is used to clean the XML input stream.
Parser seems to be buggy with special chars (0x0C, 0x00 ...)

param: String  $stream
return: String  cleaned stream



Généré le : Sat Feb 24 14:40:03 2007 par Balluche grâce à PHPXref 0.7