Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
gy4443
chemotion_eln_server
Commits
d6a3f421
Commit
d6a3f421
authored
Oct 04, 2017
by
an.nguyen
Browse files
Add search_by_substring for Sample model
parent
abaeab71
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/models/sample.rb
View file @
d6a3f421
...
...
@@ -32,6 +32,12 @@ class Sample < ActiveRecord::Base
molecule: :cano_smiles
}
pg_search_scope
:search_by_substring
,
against:
%i[
name short_label external_label
]
,
associated_against:
{
molecule:
%i[sum_formular iupac_name inchistring cano_smiles]
},
using:
{
trigram:
{
threshold:
0.0001
}
}
pg_search_scope
:search_by_sample_name
,
against: :name
pg_search_scope
:search_by_sample_short_label
,
against: :short_label
pg_search_scope
:search_by_sample_external_label
,
against: :external_label
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment