forked from Gitlink/forgeplus
fixed 项目搜索先es search
This commit is contained in:
parent
3ff3502bbc
commit
c7a6d78c15
|
@ -10,7 +10,7 @@ class Projects::ElasticsearchService < ApplicationService
|
|||
api_url = "#{domain}/search?page=1&size=1000&term=#{@keyword}&type=1"
|
||||
response = Faraday.get(api_url)
|
||||
result = JSON.parse(response&.body)
|
||||
project_ids = result[:data][:rows].map{|d|d[:instanceId]}
|
||||
project_ids = result['data']['rows'].map{|d|d['instanceId']}
|
||||
project_ids
|
||||
rescue => e
|
||||
puts "ElasticsearchService error: #{e.message}"
|
||||
|
|
Loading…
Reference in New Issue