File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -194,6 +194,15 @@ public function findByQuery(SearchDemand $searchDemand): array
194194 ],
195195 ],
196196 ],
197+ 'highlight ' => [
198+ 'fields ' => [
199+ 'snippet_content ' => [
200+ 'fragment_size ' => 400 ,
201+ 'number_of_fragments ' => 1
202+ ]
203+ ],
204+ 'encoder ' => 'html '
205+ ]
197206 ];
198207 $ filters = $ searchDemand ->getFilters ();
199208 if (!empty ($ filters )) {
Original file line number Diff line number Diff line change 5656 display : block ;
5757 }
5858 }
59+ .summary em {
60+ font-style : normal ;
61+ font-weight : 600 ;
62+ }
5963 </style >
6064{% endblock %}
6165
7882 <span class =" badge badge-primary text-decoration-none" >{{ version }}</span >
7983 {% endfor %}
8084 </h4 >
81- <p class =" summary" >{{ hit .data .snippet_content | slice (0 , 400 ) }}...</p >
85+ {% if hit .highlights .snippet_content [0 ] %}
86+ <p class =" summary" >{{ hit .highlights .snippet_content [0 ] | raw }}...</p >
87+ {% else %}
88+ <p class =" summary" >{{ hit .data .snippet_content | slice (0 , 400 ) }}...</p >
89+ {% endif %}
8290 </a >
8391 {% endfor %}
8492 </ul >
You can’t perform that action at this time.
0 commit comments