I am new to Solr 6.0 & Solarium integration. I have the set up running but results are not being returned where fields do
not exactly match query. e.g I have a url field containig 'http://ayodeji.com'
or 'http://ayo-tuntun.com'
but a query for 'ayo' does not return these rows, Although they are returned with *:*
queries in the Solr admin section. I have changed string to text in the managed-schema file but still wont work.
Please help
Below is the code from Solarium dismax example that I am using. Thank you.
$client = new Solarium\Client($config);
$query = $client->createSelect();
$dismax = $query->getDisMax();
$dismax->setQueryFields('url^5 author^3 body^1 title');
$searchTerm = 'ayo';
$query->setQuery($searchTerm);
$resultset = $client->select($query);
echo 'NumFound: '.$resultset->getNumFound();
foreach ($resultset as $document) {
echo '<hr/><table>';
// the documents are also iterable, to get all fields
foreach ($document as $field => $value) {
// this converts multivalue fields to a comma-separated string
if (is_array($value)) {
$value = implode(', ', $value);
}
echo '<tr><th>' . $field . '</th><td>' . $value . '</td></tr>';
}
echo '</table>';
}