Skip to content

Commit

Permalink
Merge branch 'feature/index-ontology-agent-metadata' into stage
Browse files Browse the repository at this point in the history
  • Loading branch information
syphax-bouazzouni committed Apr 7, 2024
2 parents 7128e3c + 7041245 commit 5ebc576
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions controllers/search_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down

0 comments on commit 5ebc576

Please sign in to comment.