SolrQuery::setExpand

(PECL solr >= 2.2.0)

SolrQuery::setExpandActive/désactive le composant Expand

Description

public SolrQuery::setExpand(bool $value): SolrQuery

Active/désactive le composant Expand.

Liste de paramètres

value

Un drapeau booléen

Valeurs de retour

SolrQuery

Exemples

Exemple #1 Exemple de SolrQuery::setExpand()

<?php

$query
= new SolrQuery('lucene');

$query
->setExpand(true)
->
setExpandRows(50)
->
setExpandQuery('text:product')
->
addExpandFilterQuery('manu:apple')
->
addExpandFilterQuery('inStock:true')
->
addExpandSortField('score', SolrQuery::ORDER_DESC)
->
addExpandSortField('title', SolrQuery::ORDER_ASC);

echo
$query.PHP_EOL;

?>

Résultat de l'exemple ci-dessus est similaire à :

q=lucene&expand=true&expand.rows=50&expand.q=text:product&expand.fq=manu:apple&expand.fq=inStock:true&expand.sort=score desc,title asc

Voir aussi

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top