Skip to content

Commit

Permalink
add ontology search content types filter
Browse files Browse the repository at this point in the history
  • Loading branch information
syphax-bouazzouni committed Apr 11, 2024
1 parent 15d2938 commit 7cfb841
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 16 deletions.
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ gem 'haml', '~> 5.2.2' # pin see https://github.com/ncbo/ontologies_api/pull/107
gem 'redcarpet'

# NCBO gems (can be from a local dev path or from rubygems/git)
gem 'goo', github: 'ontoportal-lirmm/goo', branch: 'development'
gem 'ncbo_annotator', git: 'https://github.com/ontoportal-lirmm/ncbo_annotator.git', branch: 'development'
gem 'ncbo_cron', git: 'https://github.com/ontoportal-lirmm/ncbo_cron.git', branch: 'master'
gem 'ncbo_ontology_recommender', git: 'https://github.com/ncbo/ncbo_ontology_recommender.git', branch: 'master'
gem 'sparql-client', github: 'ontoportal-lirmm/sparql-client', branch: 'master'
gem 'ontologies_linked_data', git: 'https://github.com/ontoportal-lirmm/ontologies_linked_data.git', branch: 'master'
gem 'goo', github: 'ontoportal-lirmm/goo', branch: 'development'
gem 'ontologies_linked_data', git: 'https://github.com/ontoportal-lirmm/ontologies_linked_data.git', branch: 'development'

group :development do
# bcrypt_pbkdf and ed35519 is required for capistrano deployments when using ed25519 keys; see https://github.com/miloserdow/capistrano-deploy/issues/42
Expand Down
30 changes: 16 additions & 14 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ GIT

GIT
remote: https://github.com/ontoportal-lirmm/goo.git
revision: 3f8b1f0b62c4334306f9ed5cb7b17a1b645e7db3
revision: 0e554fce49713ce4d5a742a06c2fb59a547caf47
branch: development
specs:
goo (0.0.2)
Expand Down Expand Up @@ -57,7 +57,7 @@ GIT

GIT
remote: https://github.com/ontoportal-lirmm/ontologies_linked_data.git
revision: 337dce98ec27627d14a440ff2a6ed09483cdac12
revision: 026c9c46baf6c0d638568528c2adcb7bcb1c2796
branch: development
specs:
ontologies_linked_data (0.0.1)
Expand Down Expand Up @@ -183,7 +183,7 @@ GEM
google-cloud-errors (~> 1.0)
google-apis-analytics_v3 (0.15.0)
google-apis-core (>= 0.14.0, < 2.a)
google-apis-core (0.14.0)
google-apis-core (0.14.1)
addressable (~> 2.5, >= 2.5.1)
googleauth (~> 1.9)
httpclient (>= 2.8.1, < 3.a)
Expand All @@ -203,7 +203,7 @@ GEM
google-protobuf (~> 3.18)
googleapis-common-protos-types (~> 1.7)
grpc (~> 1.41)
googleapis-common-protos-types (1.13.0)
googleapis-common-protos-types (1.14.0)
google-protobuf (~> 3.18)
googleauth (1.11.0)
faraday (>= 1.0, < 3.a)
Expand All @@ -229,13 +229,13 @@ GEM
httpclient (2.8.3)
i18n (0.9.5)
concurrent-ruby (~> 1.0)
json (2.7.1)
json (2.7.2)
json-ld (3.0.2)
multi_json (~> 1.12)
rdf (>= 2.2.8, < 4.0)
json-schema (2.8.1)
addressable (>= 2.4)
json_pure (2.7.1)
json_pure (2.7.2)
jwt (2.8.1)
base64
kgio (2.11.4)
Expand Down Expand Up @@ -273,11 +273,11 @@ GEM
net-ssh (>= 2.6.5, < 8.0.0)
net-sftp (4.0.0)
net-ssh (>= 5.0.0, < 8.0.0)
net-smtp (0.4.0.1)
net-smtp (0.5.0)
net-protocol
net-ssh (7.2.1)
net-ssh (7.2.3)
netrc (0.11.0)
newrelic_rpm (9.7.1)
newrelic_rpm (9.8.0)
oj (2.18.5)
omni_logger (0.1.4)
logger
Expand All @@ -289,7 +289,7 @@ GEM
pry (0.14.2)
coderay (~> 1.1)
method_source (~> 1.0)
public_suffix (5.0.4)
public_suffix (5.0.5)
rack (1.6.13)
rack-accept (0.4.5)
rack (>= 0.4)
Expand Down Expand Up @@ -346,7 +346,7 @@ GEM
netrc (~> 0.8)
retriable (3.1.2)
rexml (3.2.6)
rsolr (2.5.0)
rsolr (2.6.0)
builder (>= 2.1.2)
faraday (>= 0.9, < 3, != 2.0.0)
ruby-xxHash (0.4.0.2)
Expand Down Expand Up @@ -381,7 +381,8 @@ GEM
rack-test
sinatra (~> 1.4.0)
tilt (>= 1.3, < 3)
sshkit (1.22.0)
sshkit (1.22.1)
base64
mutex_m
net-scp (>= 1.1.2)
net-sftp (>= 2.1.2)
Expand All @@ -402,12 +403,13 @@ GEM
unicorn (>= 4, < 7)
uuid (2.3.9)
macaddr (~> 1.0)
webmock (3.23.0)
webmock (3.19.1)
addressable (>= 2.8.0)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)

PLATFORMS
x86_64-darwin-23
x86_64-linux

DEPENDENCIES
Expand Down Expand Up @@ -467,4 +469,4 @@ DEPENDENCIES
webmock (~> 3.19.1)

BUNDLED WITH
2.3.23
2.4.22
2 changes: 2 additions & 0 deletions controllers/search_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 7cfb841

Please sign in to comment.