"More Like This" クエリを使用して類似のドキュメントを検索し、フィールド 'image' に同じ値を持つドキュメントを折りたたみたいと考えています。Field Collapsing パラメータを使用しようとしましたが、「More like this」では機能しないようです。
以下は私のコードのスニペットです。"More Like This" クエリを使用して結果を折りたたむ方法を教えてください。
$url = "http://{$host}:{$port}/solr/{$core}/mlt";
$data = [
'stream.body' => $content,
'fl' => 'image,content,title,signature',
'start' => 0,
'order' => "score desc",
'wt' => 'json',
'mlt.fl' => 'content,title',
// these lines do nothing ---v
'group' => 'true',
'group.field' => 'image',
'group.sort' => 'impressions desc',
'group.main' => 'true'
];
$curlHandle = curl_init($url);
$options = array (
CURLOPT_POST => 1,
CURLOPT_POSTFIELDS => $data
);
curl_setopt_array($curlHandle , $options);
$result = json_decode(curl_exec($curlHandle));