diff --git a/controllers/search_controller.rb b/controllers/search_controller.rb index ee5210f3..9a354f08 100644 --- a/controllers/search_controller.rb +++ b/controllers/search_controller.rb @@ -100,16 +100,18 @@ class SearchController < ApplicationController query = params[:query] || params[:q] page, page_size = page_params ontologies = params.fetch("ontologies", "").split(',') + types = params.fetch("types", "").split(',') qf = params.fetch("qf", "") fq = [] fq << ontologies.map { |x| "ontology_t:\"#{x}\"" }.join(' OR ') unless ontologies.blank? + fq << types.map { |x| "type_t:\"#{x}\" OR type_txt:\"#{x}\"" }.join(' OR ') unless types.blank? conn = SOLR::SolrConnector.new(Goo.search_conf, :ontology_data) - resp = conn.search(query, fq: fq, qf: qf, defType: "edimax", - page: page, page_size: page_size) + resp = conn.search(query, fq: fq, qf: qf, defType: "edismax", + start: (page - 1) * page_size, rows: page_size) total_found = resp["response"]["numFound"] docs = resp["response"]["docs"]