(PECL solr >= 2.2.0)
SolrQuery::setExpand — Enables/Disables the Expand Component
Enables/Disables the Expand Component.
value
Bool flag
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;
?>
The above example will output something similar to:
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
Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!
Check out: eBank.nz (Art Generator) |
Netwrck.com (AI Tools) |
Text-Generator.io (AI API) |
BitBank.nz (Crypto AI) |
ReadingTime (Kids Reading) |
RewordGame |
BigMultiplayerChess |
WebFiddle |
How.nz |
Helix AI Assistant