Commit 5c9cf52e by Thanh Hung Pham

search result

parent ccb92b52
...@@ -11,15 +11,14 @@ class JobsController < ApplicationController ...@@ -11,15 +11,14 @@ class JobsController < ApplicationController
rsolr = RSolr.connect url: 'http://localhost:8983/solr/veNJOBDATA/' rsolr = RSolr.connect url: 'http://localhost:8983/solr/veNJOBDATA/'
response = rsolr.get 'select', params: { response = rsolr.get 'select', params: {
q: @search_conditions, q: @search_conditions
start: 0,
rows: 10
} }
@job_ids = [] @job_ids = []
response['response']['docs'].each do |doc| response['response']['docs'].each do |doc|
@job_ids.push(doc['job_id']) @job_ids.push(doc['job_id'])
end end
@job_ids = Job.limit(20).ids if @job_ids.length.zero?
redirect_to jobs_show_path(job_ids: @job_ids, search_conditions: @search_conditions) redirect_to jobs_show_path(job_ids: @job_ids, search_conditions: @search_conditions)
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment