Cross Reference: searching.rb
xref
: /
ontohub
/
app
/
models
/
ontology
/
searching.rb
Home
History
Annotate
Line#
Navigate
Download
Search
only in
./
searching.rb revision 79276084d5247a83e49faa3d197e4e2774fd33c4
758
N/A
module
Ontology
::
Searching
758
N/A
extend
ActiveSupport
::
Concern
758
N/A
758
N/A
included
do
758
N/A
include
Elasticsearch
::
Model
758
N/A
include
Elasticsearch
::
Model
::
Callbacks
758
N/A
758
N/A
mapping
do
758
N/A
indexes
:
name
,
type
:
'string'
,
analyzer
:
'simple'
758
N/A
indexes
:
description
,
analyzer
:
'simple'
758
N/A
end
758
N/A
758
N/A
scope
:
filter_by_ontology_type
, ->
(
type_id
)
{
where
(
ontology_type_id
:
type_id
)
}
758
N/A
758
N/A
scope
:
filter_by_project
, ->
(
project_id
)
do
758
N/A
joins
(:
projects
)
.
where
(
"
projects.id
= #{project_id}"
)
758
N/A
end
758
N/A
758
N/A
scope
:
filter_by_formality
, ->
(
formality_id
)
do
758
N/A
where
(
formality_level_id
:
formality_id
)
758
N/A
end
758
N/A
758
N/A
scope
:
filter_by_license
, ->
(
license_id
)
do
758
N/A
joins
(:
license_models
)
.
where
(
"
license_models.id
= #{license_id}"
)
758
N/A
end
758
N/A
758
N/A
scope
:
filter_by_task
, ->
(
task_id
)
do
758
N/A
joins
(:
tasks
)
.
where
(
"
tasks.id
= #{task_id}"
)
758
N/A
end
758
N/A
end
758
N/A
758
N/A
end