mirror of
https://github.com/discourse/discourse.git
synced 2025-02-22 08:00:53 +08:00
FIX: Specify config when generating tsquery using ts_headline
.
This commit is contained in:
parent
fb9c2e5f89
commit
ab2b6f8dea
@ -1162,7 +1162,7 @@ class Search
|
|||||||
default_scope
|
default_scope
|
||||||
.joins("INNER JOIN post_search_data pd ON pd.post_id = posts.id")
|
.joins("INNER JOIN post_search_data pd ON pd.post_id = posts.id")
|
||||||
.select(
|
.select(
|
||||||
"TS_HEADLINE(#{default_ts_config}, pd.raw_data, PLAINTO_TSQUERY('#{@term.present? ? PG::Connection.escape_string(@term) : nil}'), 'ShortWord=0, MaxFragments=1, MinWords=50, MaxWords=51, StartSel=''<span class=\"#{HIGHLIGHT_CSS_CLASS}\">'', StopSel=''</span>''') AS headline",
|
"TS_HEADLINE(#{default_ts_config}, pd.raw_data, PLAINTO_TSQUERY(#{default_ts_config}, '#{@term.present? ? PG::Connection.escape_string(@term) : nil}'), 'ShortWord=0, MaxFragments=1, MinWords=50, MaxWords=51, StartSel=''<span class=\"#{HIGHLIGHT_CSS_CLASS}\">'', StopSel=''</span>''') AS headline",
|
||||||
default_scope.arel.projections
|
default_scope.arel.projections
|
||||||
)
|
)
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user