From 70412459459a8df319039476cd47296de4c3d1e1 Mon Sep 17 00:00:00 2001 From: Syphax bouazzouni Date: Tue, 19 Mar 2024 15:16:41 +0100 Subject: [PATCH] add ontology search content types filter --- controllers/search_controller.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/controllers/search_controller.rb b/controllers/search_controller.rb index 78dd1175..9a354f08 100644 --- a/controllers/search_controller.rb +++ b/controllers/search_controller.rb @@ -100,11 +100,13 @@ 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)