首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

SolrQuery::setExpand

(PECL solr >= 2.2.0)

SolrQuery::setExpand — Enables/Disables the Expand Component

Description

代码语言:javascript
复制
public SolrQuery SolrQuery::setExpand ( bool $value )

Enables/Disables the Expand Component.

Parameters

value

Bool flag

Return Values

SolrQuery

Examples

Example #1 SolrQuery::setExpand() example

代码语言:javascript
复制
<?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;

?>

The above example will output something similar to:

代码语言:javascript
复制
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

See Also

  • SolrQuery::addExpandSortField() - Orders the documents within the expanded groups (expand.sort parameter).
  • SolrQuery::removeExpandSortField() - Removes an expand sort field from the expand.sort parameter.
  • SolrQuery::setExpandRows() - Sets the number of rows to display in each group (expand.rows). Server Default 5
  • SolrQuery::setExpandQuery() - Sets the expand.q parameter
  • SolrQuery::addExpandFilterQuery() - Overrides main filter query, determines which documents to include in the main group.
  • SolrQuery::removeExpandFilterQuery() - Removes an expand filter query

← SolrQuery::setEchoParams

SolrQuery::setExpandQuery →

代码语言:txt
复制
 ? 1997–2017 The PHP Documentation Group

Licensed under the Creative Commons Attribution License v3.0 or later.

扫码关注腾讯云开发者

领取腾讯云代金券

http://www.vxiaotou.com