Nuxtstop

For all things nuxt.js

A simple search in Drupal 8

6 0

Add a new view:

/admin/structure/views/add
Enter fullscreen mode Exit fullscreen mode

If you are outputting content instead of fields, check the Commit to use fields box in the format settings.

Image description

Add the fields to be searched:

Image description

In the Filter Criteria we add the Combined Fields Filter field and make it expanded.

Image description

In the "Operator" select box, select "Contains". 

In the "Select fields to filter" field, while holding down the CTRL key, select the fields to be searched.

Image description

Save a view.

Go to the search page:

Image description

The search form is linked to the page. To make it a separate block:

In view settings → Advanced → Expanded form → Expanded form in block → Set radiobutton to "Yes".

Image description

In the block diagram:

/admin/structure/block
Enter fullscreen mode Exit fullscreen mode

Add a search box for our view:

Image description

I put it in the sidebar:

Image description

If you need to make a very simple search, this approach is for you.

Otherwise, I would advise to look in the direction of SEARCH API.