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>
</select>

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)
AS
BEGIN

	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),
              '',
              getdate()
       from kb_articles where isPublish=1 and ( (title like '%'+@q+'%') or (text like '%'+@q+'%') )
       order by id desc

       select * from #result
		drop table #result
        return
    end

    -- other searches ....


END

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

SQL-tool for creating personal accounts on the site

The essence of the approach and the history of the creation of Falcon Space
Web platform for creating personal accounts

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

MS SQL web applications. Affiliate program for developers and web studios

You can develop yourself or collaborate with us for web development on the Falcon Space platform using only SQL and HTML.
View examples with SQL code
Platform documentation
Working on MS SQL Server
Note