Skip to content

Commit 4aed0a9

Browse files
authored
Merge pull request #831 from ElixirTeSS/index-external-resources
Index `external resource` titles for text search
2 parents 01c0d35 + a831e16 commit 4aed0a9

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

app/models/concerns/has_external_resources.rb

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,17 @@ module HasExternalResources
1010
if TeSS::Config.solr_enabled
1111
# :nocov:
1212
searchable do
13+
text :related_resources do
14+
external_resources.map(&:title)
15+
end
1316
string :tools, multiple: true do
14-
self.external_resources.select(&:is_tool?).collect(&:title)
17+
external_resources.select(&:is_tool?).map(&:title)
1518
end
1619
string :standard_database_or_policy, multiple: true do
17-
self.external_resources.select(&:is_fairsharing?).collect(&:title)
20+
external_resources.select(&:is_fairsharing?).map(&:title)
1821
end
1922
string :related_resources, multiple: true do
20-
self.external_resources.select(&:is_generic_external_resource?).collect(&:title)
23+
external_resources.select(&:is_generic_external_resource?).map(&:title)
2124
end
2225
end
2326
# :nocov:

0 commit comments

Comments
 (0)