Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
  • This project
    • Loading...
  • Sign in / Register
V
venjob_thanhnd
  • 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 3
    • Merge Requests 3
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Wiki
    • Wiki
  • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • thanhnd
  • venjob_thanhnd
  • Merge Requests
  • !9

Open
Opened May 29, 2020 by thanhnd@thanhnd 
  • Report abuse
Report abuse

Using rescue

×

Check out, review, and merge locally

Step 1. Fetch and check out the branch for this merge request

git fetch origin
git checkout -b using_rescue origin/using_rescue

Step 2. Review the changes locally

Step 3. Merge the branch and fix any conflicts that come up

git checkout master
git merge --no-ff using_rescue

Step 4. Push the result of the merge to GitLab

git push origin master

Note that pushing to GitLab requires write access to this repository.

Tip: You can also checkout merge requests locally by following these guidelines.

  • Discussion 4
  • Commits 17
  • Pipelines 1
  • Changes 81
{{ resolvedDiscussionCount }}/{{ discussionCount }} {{ resolvedCountText }} resolved
  • Trịnh Hoàng Phúc
    @phucth started a discussion on commit f302f7cb May 05, 2020
    Last updated by thanhnd May 08, 2020
    lib/solr.rb 0 → 100644
    1 require 'rsolr'
    2 class Solr
    3 attr_accessor :response, :solr
    4 def initialize
    5 # Direct connection
    6 @solr = RSolr.connect :url => 'http://localhost:8983/solr/jobs/'
    7 @response = nil
    8 end
    9
    10 # send a request to /select
    11 def query (cond)
    • Trịnh Hoàng Phúc @phucth commented May 05, 2020

      anh @thanhnd có thể thêm phân trang bằng cách này solr.paginate 1, 10, "select", :params => {:q => "test"}

      method query anh thêm 1 param truyền từ controller qua, lấy cái Settings.page như anh dùng ở commit trước

      Link tài liệu: https://github.com/rsolr/rsolr#pagination-

      Edited May 05, 2020 by Trịnh Hoàng Phúc
      anh @thanhnd có thể thêm phân trang bằng cách này `solr.paginate 1, 10, "select", :params => {:q => "test"}` `method query` anh thêm 1 param truyền từ controller qua, lấy cái `Settings.page` như anh dùng ở commit trước Link tài liệu: https://github.com/rsolr/rsolr#pagination-
    • thanhnd @thanhnd commented May 08, 2020
      Master

      fixed

      fixed
    Please register or sign in to reply
  • Trịnh Hoàng Phúc
    @phucth started a discussion on commit f302f7cb May 05, 2020
    Last updated by thanhnd May 08, 2020
    app/controllers/jobs_controller.rb
    12 12 def search
    13 13 return redirect_to root_path, alert: "Empty field!" if params[:search].blank?
    14 14
    15 @search_job = Job.includes(:city).where("job_name LIKE ?","%#{params[:search]}%")
    16 @pagin_job = @search_job.page(params[:page]).per(Settings.page)
    15 #@search_job = Job.includes(:city).where("job_name LIKE ?","%#{params[:search]}%")
    16 #@pagin_job = @search_job.page(params[:page]).per(Settings.page)
    17
    18 solr_rs = Solr.new
    19 @search_job = solr_rs.query(params[:search])
    • Trịnh Hoàng Phúc @phucth commented May 05, 2020

      Do rsolr sử dụng response['response']['docs'] để phân trang nên đoạn này anh gán

      @pagin_job = solr_rs.query(params[:search])

      Do `rsolr` sử dụng `response['response']['docs']` để phân trang nên đoạn này anh gán `@pagin_job = solr_rs.query(params[:search])`
    • thanhnd @thanhnd commented May 08, 2020
      Master

      fixed

      fixed
    Please register or sign in to reply
  • Write
  • Preview
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 sign in to comment
Assignee
No assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
1
1 participant
Reference: thanhnd/venjob_thanhnd!9