How to make a separate universal search

You can insert a universal search anywhere on the page, as well as make several of them on the site. Each of them will be processed by the same search procedure, but it may be passed a different typeID. However, different types of searches can be performed on different sets of objects (i.e., as specified in the sql procedure.)

To place a global search, we use a similar layout: 

<select class="form-control  as-select-search hide" data-url="/controls/search/search" data-itemid="100" data-minlength="1" data-delay="1000">
  <option value="0">Search for documentation...</option>

data-itemID задает @typeID in the procedure falcon_search.

You can also set the search delay when typing from the keyboard using the data-delay attribute and the minimum number of characters to search using the data-minlength attribute. 

In the search procedure, you can process it as follows: 

CREATE PROCEDURE [dbo].[falcon_search]
   @q nvarchar(256),
   @typeID int,
  @page nvarchar(256) = '',
  @username nvarchar(256)

	CREATE TABLE dbo.#result (id int, [text] nvarchar(max), [desc] nvarchar(max),[type] nvarchar(256),
	[date] date)

    if(@typeID=100) begin
      -- the work of the individual search
       insert into #result
       select top 15 id,
       		  ' '+title+'',
              'Обновил: ' + updatedBy + ' ' + convert(nvarchar,isnull(updated,'2020-01-01'),104) + ' ' + LEFT(convert(nvarchar, isnull(updated,'2020-01-01'),108),5),
       from kb_articles where isPublish=1 and ( (title like '%'+@q+'%') or (text like '%'+@q+'%') )
       order by id desc

       select * from #result
		drop table #result

    -- other searches ....


An example of how this search works is available in the knowledge base (top right). 

Falcon Space is a functional web development platform on a narrow stack MS SQL/Bootstrap. Falcon Space Gettting started

Falcon Space Platform

This is a reduction in the cost of ownership

at the expense of fewer people to support

This is a quick change

while using the program

This is a modern interface

full adaptation for mobile devices