Search Engine remove result not matched
This commit is contained in:
parent
2f4c2c721a
commit
92d882703b
|
@ -71,8 +71,10 @@ class SiteSearchController < ApplicationController
|
|||
res[:content].gsub!(/(#{k})/i, '<b>\1</b>') rescue ""
|
||||
end
|
||||
|
||||
result.delete(res) if res[:matches]==0
|
||||
next if res[:matches]==0
|
||||
if res[:matches]==0
|
||||
result = result - [res]
|
||||
next
|
||||
end
|
||||
|
||||
index = res[:content].index '<b>'
|
||||
unless index.nil?
|
||||
|
@ -80,7 +82,7 @@ class SiteSearchController < ApplicationController
|
|||
deadline = 150
|
||||
res[:content] = res[:content][index, deadline]
|
||||
else
|
||||
res[:content] = res[:content][0, 150]
|
||||
res[:content] = res[:content][0, 100]
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue