update : 2015.11.03
php.shukuma.com

검색:
 
 
Enables/Disables the Expand Component

SolrQuery::setExpand

(PECL solr >= 2.2.0)

SolrQuery::setExpandEnables/Disables the Expand Component

설명

public SolrQuery SolrQuery::setExpand ( bool $value )

Enables/Disables the Expand Component.

인수

value

Bool flag

반환값

SolrQuery

예제

Example #1 SolrQuery::setExpand() example

<?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;

?>

위 예제의 출력 예시:

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

참고