強調表示された検索語を Solr 検索から出力しようとしています。Scorched で Django 1.8.4 を使用しています。
(resp = ('highlighting', self.solr_response.highlighting))
強調表示と検索ビューを既にアクティブにしており、検索からの json 出力は次のとおりです。
"highlighting": {
"f0109b89-4882-44cc-90b2-6a51561d14ee": { }, <!-- nothing here, though the result comes up)
"73bc1fe4-2c4a-4036-9373-242811e3e7d9": { },<!-- nothing here, though the result comes up)
"b7e7a44a-57c4-4378-94fc-273229b0ac7f":
{
"some_field":
[
"Bla bla bla, <em>highlighted search-term</em> bla bla bla..."
]
},
)
問題は、Django テンプレート システムに にアクセスするように指示する方法が見つからないことです(その ID は の下にあるsome_field
ため)。もちろんうまくいきません -テンプレートで強調表示された文字列を出力できるように、のようなものを連結する方法はありますか?content.highlighting
result.id
content.highlighting.result.id.some_field
{{ content.highlighting}} + {{ result.id }}