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
0
Merge Requests
0
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
Nguyen Ngoc Nghia
VeNJOB
Commits
b7e99753
Commit
b7e99753
authored
Feb 17, 2020
by
nnnghia98
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
count jobs on Solr
parent
77f70a75
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
3 deletions
+4
-3
app/controllers/jobs_controller.rb
+2
-1
app/services/solr_service.rb
+1
-1
app/views/jobs/index.html.erb
+1
-1
No files found.
app/controllers/jobs_controller.rb
View file @
b7e99753
...
...
@@ -13,7 +13,8 @@ class JobsController < ApplicationController
@jobs
=
@industry
.
jobs
@jobs
=
@jobs
.
page
(
params
[
:page
]).
per
(
Settings
.
job
.
per_page
).
decorate
else
@jobs
=
SolrService
.
new
.
search
(
@search
)
@jobs_count
=
SolrService
.
new
.
search
(
@search
)[
"numFound"
]
@jobs
=
SolrService
.
new
.
search
(
@search
)[
"docs"
]
end
@jobs
=
Kaminari
.
paginate_array
(
@jobs
).
page
(
params
[
:page
]).
per
(
Settings
.
job
.
per_page
)
...
...
app/services/solr_service.rb
View file @
b7e99753
...
...
@@ -41,7 +41,7 @@ class SolrService
# fq: [industry, city],
rows:
Job
.
count
}
response
[
"response"
]
[
"docs"
]
response
[
"response"
]
end
def
escape_str
(
str
)
...
...
app/views/jobs/index.html.erb
View file @
b7e99753
...
...
@@ -4,7 +4,7 @@
<%
end
%>
<h3>
Total:
<%=
params
[
:city_id
]
?
@city
.
job_count
:
(
params
[
:industry_id
]
?
@industry
.
job_count
:
"Will be count on Solr"
)
%>
</h3>
(
params
[
:industry_id
]
?
@industry
.
job_count
:
@jobs_count
)
%>
</h3>
<h3>
Result for:
<%=
params
[
:city_id
]
?
"City:
#{
@city
.
name
}
"
:
(
params
[
:industry_id
]
?
"Industry:
#{
@industry
.
name
}
"
:
params
[
:search
])
%>
</h3>
...
...
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