Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
veNJOB
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Thanh Hung Pham
veNJOB
Commits
156a27e7
Commit
156a27e7
authored
Jul 12, 2017
by
Thanh Hung Pham
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add rsolr success
parent
e089ae33
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
0 deletions
+25
-0
Gemfile
+1
-0
Gemfile.lock
+7
-0
app/controllers/jobs_controller.rb
+17
-0
No files found.
Gemfile
View file @
156a27e7
...
...
@@ -30,6 +30,7 @@ gem 'jbuilder', '~> 2.5'
# gem '
redis
', '~> 3.0'
# Use ActiveModel has_secure_password
gem
'
bcrypt
'
,
'~> 3.1.7'
gem
'
rsolr
'
gem
'
whenever
'
# Use Capistrano for deployment
...
...
Gemfile.lock
View file @
156a27e7
...
...
@@ -80,6 +80,8 @@ GEM
erubi (1.6.1)
erubis (2.7.0)
execjs (2.7.0)
faraday (0.12.1)
multipart-post (>= 1.2, < 3)
ffi (1.9.18)
figaro (1.1.1)
thor (~> 0.14)
...
...
@@ -120,6 +122,7 @@ GEM
mini_portile2 (2.2.0)
minitest (5.10.2)
multi_json (1.12.1)
multipart-post (2.0.0)
mysql2 (0.4.7)
nio4r (2.1.0)
nokogiri (1.8.0)
...
...
@@ -160,6 +163,9 @@ GEM
responders (2.4.0)
actionpack (>= 4.2.0, < 5.3)
railties (>= 4.2.0, < 5.3)
rsolr (2.0.2)
builder (>= 2.1.2)
faraday
ruby_dep (1.5.0)
rubyzip (1.2.1)
sass (3.4.24)
...
...
@@ -228,6 +234,7 @@ DEPENDENCIES
mysql2 (>= 0.3.18, < 0.5)
puma (~> 3.7)
rails (~> 5.1.1)
rsolr
rubyzip
sass-rails (~> 5.0)
selenium-webdriver
...
...
app/controllers/jobs_controller.rb
View file @
156a27e7
require
'rsolr'
class
JobsController
<
ApplicationController
def
applied_jobs
@applied_jobs
=
Apply
.
where
(
user_id:
current_user
.
id
)
...
...
@@ -6,6 +8,21 @@ class JobsController < ApplicationController
def
search
@search_conditions
=
params
[
:text_search
]
rsolr
=
RSolr
.
connect
url:
'http://localhost:8983/solr/veNJOBDATA/'
# rsolr.add(job_id: 1, job_name: 'a', job_description: 'b')
# rsolr.update data: '<commit/>', headers: { 'Content-Type' => 'text/xml' }
# rsolr.update data: { optimize: true }.to_json, headers: { 'Content-Type' => 'application/json' }
# rsolr.commit
response
=
rsolr
.
get
'select'
,
params:
{
q:
@search_conditions
,
start:
0
,
rows:
10
}
response
[
'response'
][
'docs'
]
raise
'test'
# search = rsolr.select params: { q: @search_conditions }
# search['response']['docs']
redirect_to
jobs_show_path
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment