(params *ftsParams)
| 174 | } |
| 175 | |
| 176 | func getFTSBodyExpression(params *ftsParams) string { |
| 177 | if params != nil && params.HighlightAll { |
| 178 | return "highlight(notes_fts, 0, '<dnotehl>', '</dnotehl>') AS body" |
| 179 | } |
| 180 | |
| 181 | return "snippet(notes_fts, 0, '<dnotehl>', '</dnotehl>', '...', 50) AS body" |
| 182 | } |
| 183 | |
| 184 | func selectFTSFields(conn *gorm.DB, params *ftsParams) *gorm.DB { |
| 185 | bodyExpr := getFTSBodyExpression(params) |