]>
cat aescling's git repositories - mastodon.git/blob - app/services/tag_search_service.rb
64dd76bb778d7c78c20e6e04262ee940b15edfd9
1 # frozen_string_literal: true
3 class TagSearchService
< BaseService
4 def call(query
, options
= {})
5 @query = query
.strip
.gsub(/\A#/, '')
6 @offset = options
[:offset].to_i
7 @limit = options
[:limit].to_i
18 def from_elasticsearch
24 fields
: %w(name
.edge_ngram name
),
50 boost_mode
: 'multiply',
76 TagsIndex
.query(query
).filter(filter
).limit(@limit).offset(@offset).objects
.compact
80 Tag
.search_for(@query, @limit, @offset)
This page took 0.089094 seconds and 4 git commands to generate.