--- a/displayContract.php +++ b/displayContract.php @@ -45,6 +45,9 @@ case "category": echo ''.$value.''; break; + case "SONID": + echo '' . $value . ""; + break; case "agencyName": echo '' . $value . ""; break; @@ -72,6 +75,35 @@ '; +/*$query = $solr_client->createMoreLikeThis(); + +$query->setQuery('id:'.$_REQUEST['CNID']); +$query->setMltFields('description'); +$query->setMinimumDocumentFrequency(1); +$query->setMinimumTermFrequency(1); +$query->setInterestingTerms('description'); +$query->setMatchInclude(true); + +// this executes the query and returns the result +$resultset = $solr_client->select($query); + +// display the total number of documents found by solr +echo 'Found '.$resultset->getNumFound(). ' similar results: '; + + +foreach ($resultset as $row) { +setlocale(LC_MONETARY, 'en_US'); + $value = number_format(doubleval($row['value'][0]), 2); + echo (" + + + + + + "); +} +echo "
{$row['id']}{$row['description'][0]}\$$value{$row['agencyName'][0]}{$row['contractStart'][0]}{$row['supplierName'][0]}
";*/ + $query = 'SELECT * FROM heuristic_results where "CNID" = :CNID'; $query = $conn->prepare($query);