Search for tags

@Route("/{query}", name="tags_search", defaults={"query" = ""})
@Method("GET")
167861
public function searchAction($query)
    {
        $tags = $this->get('fpn_tag.tag_manager')->findTags($query);
        $tags = array_map(function ($value) {
            return $value['name'];
        }, $tags);
        return new JsonResponse($tags);
    }
664372
def find_by_id(self, tag, params={}, **options): 
        
        path = "/tags/%s" % (tag)
        return self.client.get(path, params, **options)
657744
public function index(Request $request)
    {
        $query = Tag::query();

        if ($request->has('filter.containing')) {
            $query->containing($request['filter']['containing']);
        }

        if ($request->has('filter.type')) {
            $query->where('type', $request['filter']['type']);
        }

        if ($request->has('limit')) {
            $query->limit($request['limit']);
        }

        return $query->get()->map(function (Tag $tag) {
            return $tag->name;
        });
    }
963147
def tags_get(params={})
      options = create_params(params)
      tags = self.class.get('/tags/get', options)['tags']['tag']
      tags = [] if tags.nil?
      tags = [*tags]
      tags.map { |p| Tag.new(Util.symbolize_keys(p)) }
    end
923471
function routeTags(tag, content, indentStr, indentLevel) {
    if (COMPONENT.test(tag)) {
        return jxh(content, indentStr, indentLevel);
    } else {
        let attrs = getType(content)==='object' ? getAttributes(content) : '';
        switch (getType(content)) {
            case 'null':
            case 'undefined':
            case 'NaN':
            case 'string':
            case 'number':
            case 'boolean':
                return renderElement(tag, attrs, content, indentStr, indentLevel);
                break;
            case 'array':
                return parseArray(tag, attrs, content, indentStr, indentLevel);
                break;
            case 'object':
                return parseObject(tag, attrs, content, indentStr, indentLevel);
                break;
            default:
                objTypeError(content);
                break;
        }
    }
}
515021
function getTags (posts) {
  var tags = posts.reduce(function (tags, post) {
    if (!post.tags || !Array.isArray(post.tags)) return tags;
    return tags.concat(post.tags);
  }, []);

  return _.unique(tags).sort();
}
1188926
function getQueries(req, end) {
  var urlencoded = /^application\/x-www-form-urlencoded/;
  var multipart = /^multipart\/form-data/;
  var contentType = req.headers['content-type'] || '';

  if (multipart.test(contentType)) {
    // Multipart data.
    req.form = req.form || new formidable.IncomingForm();
    req.form.multiples = true;
    req.form.parse(req, function(err, fields, files) {
      req.fields = fields;
      req.files = files;
      // Ensure that files are arrays.
      for (var key in req.files) {
        if (!(req.files[key] instanceof Array)) {
          req.files[key] = [req.files[key]];
        }
      }
      if (err == null) {
        addToQuery(req, req.fields);
        addToQuery(req, req.files);
      }
      end(err);
    });

  } else if (urlencoded.test(contentType)) {
    // URL encoded data.
    var chunks;
    var gotrequest = function (chunk) {
      if (chunk !== undefined) {
        if (chunks === undefined) {
          chunks = chunk;
        } else {
          chunks = Buffer.concat([chunks, chunk]);
        }
      }
    };
    req.on('data', gotrequest);
    req.on('end', function(err) {
      if (req.server.saveRequestChunks) {
        req.savedChunks = chunks;
      }
      var strquery = chunks? chunks.toString(): '';
      jsonFromQuery(strquery, req.query);
      end(err);
    });
  } else {
    // URL query parameters.
    var search = req.uri.search || '';
    jsonFromQuery(search.slice(1), req.query);
    end();
  }
}
941804
public function scopeByTagName($query, $tag_name)
	{
		// mormalize string
		$tag_name = app(TaggingUtility::class)->normalizeTagName(trim($tag_name));
		return $query->where('name', $tag_name);
	}
697405
public function getTagsFromSearchResult()
    {
        $tags = $tagsForResult = array();
        $tagChar = $this->pObj->extConf['prePostTagChar'];
        $tagDivider = $tagChar . ',' . $tagChar;

        if ($this->sphinxSearchEnabled()) {
            $tagsForResult = $this->getTagsFromSphinx();
        } else {
            $tagsForResult = $this->getTagsFromMySQL();
        }
        foreach ($tagsForResult as $tagSet) {
            $tagSet = explode($tagDivider, trim($tagSet, $tagChar));
            foreach ($tagSet as $tag) {
                $tags[$tag] += 1;
            }
        }
        return $tags;
    }
526917
def search_tags(self, tag_name):

        

        response = self._req('/browse/tags/search', {
            "tag_name":tag_name
        })

        tags = list()

        for item in response['results']:
            tags.append(item['tag_name'])

        return tags
1094913
function querySearch (query) {
      var results = query ? self.vegetables.filter(createFilterFor(query)) : [];
      return results;
    }
714551
def search_rules(query, params = {}, request_options = {})
      anchoring = params[:anchoring]
      context = params[:context]
      page = params[:page] || params['page'] || 0
      hits_per_page = params[:hitsPerPage] || params['hitsPerPage'] || 20
      params = {
        :query => query,
        :page => page,
        :hitsPerPage => hits_per_page
      }
      params[:anchoring] = anchoring unless anchoring.nil?
      params[:context] = context unless context.nil?
      client.post(Protocol.search_rules_uri(name), params.to_json, :read, request_options)
    end
418815
function _tag_open( &$parser, $tag, $attributes ) {
		$this->currentElement = strtoupper( $tag );

		switch( $this->currentElement ) {
			case 'QUERY':
				// Create a new query in a SQL queryset.
				// Ignore this query set if a platform is specified and it's different than the
				// current connection platform.
				if( !isset( $attributes['PLATFORM'] ) OR $this->supportedPlatform( $attributes['PLATFORM'] ) ) {
					$this->newQuery();
				} else {
					$this->discardQuery();
				}
				break;
			default:
				// print_r( array( $tag, $attributes ) );
		}
	}
225159
def query_tags(order=None, orderby=None, limit=None):
    
    from taggit.models import Tag, TaggedItem    # feature is still optional

    # Get queryset filters for published entries
    EntryModel = get_entry_model()
    ct = ContentType.objects.get_for_model(EntryModel)  # take advantage of local caching.

    entry_filter = {
        'status': EntryModel.PUBLISHED
    }
    if appsettings.FLUENT_BLOGS_FILTER_SITE_ID:
        entry_filter['parent_site'] = settings.SITE_ID

    entry_qs = EntryModel.objects.filter(**entry_filter).values_list('pk')

    # get tags
    queryset = Tag.objects.filter(
        taggit_taggeditem_items__content_type=ct,
        taggit_taggeditem_items__object_id__in=entry_qs
    ).annotate(
        count=Count('taggit_taggeditem_items')
    )

    # Ordering
    if orderby:
        queryset = queryset.order_by(*_get_order_by(order, orderby, TAG_ORDER_BY_FIELDS))
    else:
        queryset = queryset.order_by('-count')

    # Limit
    if limit:
        queryset = queryset[:limit]

    return queryset
150607
def tags(self):
		'''

		'''
		q = meta.Session.query(_tag.Tag)
		q = q.join(TagSemanticTag)
		q = q.filter_by(tag_id=self.id)
#		q = q.filter_by(state='active')
		q = q.order_by(_tag.Tag.name)
		tags = q.all()
		return tags
973253
def search(self, query=None, **kwargs):
        ""
        api_path = "/api/v2/search.json"
        api_query = {}
        if "query" in kwargs.keys():
            api_query.update(kwargs["query"])
            del kwargs["query"]
        if query:
            api_query.update({
                "query": query,
            })
        return self.call(api_path, query=api_query, **kwargs)
246426
def search
      # if full name provided then get the key and redirect to it, otherwise return similar in json
      if params[:search_key_name].present?
        @translation_key = TranslationKey.find_by_name(params[:search_key_name])
      else
        @key_names = TranslationKey.where('name LIKE ?', "%#{params[:query]}%")
      end

      respond_to do |format|
        format.html { redirect_to @translation_key}
        format.json { render json: @key_names.map(&:name) }
      end
    end