Exemples
SphinxClient::addQuery
Sphinx
PHP Manual
La classe SphinxClient
Introduction
La classe SphinxClient fournit une interface orientée objet avec Sphinx.
Synopsis de la classe
SphinxClient
SphinxClient
{
/* Méthodes */
public
int
addQuery
(
string
$query
[,
string
$index
= "*"
[,
string
$comment
= ""
]] )
public
array
buildExcerpts
(
array
$docs
,
string
$index
,
string
$words
[,
array
$opts
] )
public
array
buildKeywords
(
string
$query
,
string
$index
,
bool
$hits
)
__construct
(
void
)
public
string
escapeString
(
string
$string
)
public
string
getLastError
(
void
)
public
string
getLastWarning
(
void
)
public
array
query
(
string
$query
[,
string
$index
= "*"
[,
string
$comment
= ""
]] )
public
void
resetFilters
(
void
)
public
void
resetGroupBy
(
void
)
public
array
runQueries
(
void
)
public
bool
setArrayResult
(
bool
$array_result
)
public
bool
setConnectTimeout
(
float
$timeout
)
public
bool
setFieldWeights
(
array
$weights
)
public
bool
setFilter
(
string
$attribute
,
array
$values
[,
bool
$exclude
= false
] )
public
bool
setFilterFloatRange
(
string
$attribute
,
float
$min
,
float
$max
[,
bool
$exclude
= false
] )
public
bool
setFilterRange
(
string
$attribute
,
int
$min
,
int
$max
[,
bool
$exclude
] )
public
bool
setGeoAnchor
(
string
$attrlat
,
string
$attrlong
,
float
$latitude
,
float
$longitude
)
public
bool
setGroupBy
(
string
$attribute
,
int
$func
[,
string
$groupsort
] )
public
bool
setGroupDistinct
(
string
$attribute
)
public
bool
setIDRange
(
int
$min
,
int
$max
)
public
bool
setIndexWeights
(
array
$weights
)
public
bool
setLimits
(
int
$offset
,
int
$limit
[,
int
$max_matches
= 0
[,
int
$cutoff
= 0
]] )
public
bool
setMatchMode
(
int
$mode
)
public
bool
setMaxQueryTime
(
int
$qtime
)
public
bool
setRankingMode
(
int
$ranker
)
public
bool
setRetries
(
int
$count
[,
int
$delay
= 0
] )
public
bool
setServer
(
string
$server
,
int
$port
)
public
bool
setSortMode
(
int
$mode
[,
string
$sortby
] )
public
int
updateAttributes
(
string
$index
,
array
$attributes
,
array
$values
)
}
Sommaire
SphinxClient::addQuery
— Ajoute une requête à un batch multiple
SphinxClient::buildExcerpts
— Construit les extraits de texte
SphinxClient::buildKeywords
— Extrait les mots-clés d'une requête
SphinxClient::__construct
— Crée un nouvel objet SphinxClient
SphinxClient::escapeString
— Protège les caractères spéciaux
SphinxClient::getLastError
— Lit le dernier message d'erreur
SphinxClient::getLastWarning
— Lit la dernière alerte
SphinxClient::query
— Exécute une requête de recherche
SphinxClient::resetFilters
— Supprime tous les filtres
SphinxClient::resetGroupBy
— Supprime toutes les configurations de regroupement
SphinxClient::runQueries
— Exécute une série de requêtes de recherche
SphinxClient::setArrayResult
— Change le format du tableau de résultats
SphinxClient::setConnectTimeout
— Configure le délai d'expiration de connexion
SphinxClient::setFieldWeights
— Configure le poids des champs
SphinxClient::setFilter
— Ajoute un nouveau filtre entier
SphinxClient::setFilterFloatRange
— Ajoute un nouveau filtre décimal
SphinxClient::setFilterRange
— Ajoute un nouveau filtre d'intervalle
SphinxClient::setGeoAnchor
— Configure le point d'origine pour les calculs géographiques
SphinxClient::setGroupBy
— Configure les attributs de regroupement
SphinxClient::setGroupDistinct
— Configure les calculs au niveau des valeurs distinctes
SphinxClient::setIDRange
— Configure l'intervalle de validité des identifiants de document
SphinxClient::setIndexWeights
— Configure les poids de chaque index
SphinxClient::setLimits
— Configure l'offset et la limite du résultat
SphinxClient::setMatchMode
— Configure le mode de recherche en texte intégral
SphinxClient::setMaxQueryTime
— Configure la durée maximale de recherche
SphinxClient::setRankingMode
— Configure le mode de classement
SphinxClient::setRetries
— Configure le nombre de tentatives et le délai d'expiration
SphinxClient::setServer
— Configure l'hôte et le port searchd
SphinxClient::setSortMode
— Configure le mode de tri
SphinxClient::updateAttributes
— Modifie les attributs d'un document
Exemples
SphinxClient::addQuery
Sphinx
PHP Manual